I have 2 issues 1, this turret shoots from the base, even if i alter the source/src on the first line.
local source = self:GetPos() + Vector ( 0, 0, 24 )
local bullet = {}
bullet.Src = source
bullet.Damage = self.damage
bullet.Force = 0
bullet.Spread = Vector( math.random(10), math.random(10), 0 )
bullet.Distance = 1000
bullet.Dir = ( self.enemy:LocalToWorld( self.enemy:OBBCenter() ) - source)
my second issue is im trying to make this turret revolve around the top of the model but on the same axis, right now when you ratate the bottom, the top stays above it instead of following the model.
self:DrawModel()
self.turret:SetRenderOrigin( self:GetPos() + Vector( 0, 0, 24 ) )
local em = self:GetDTEntity( 0 )
if ( IsValid( em ) ) then
local ang = ( self:GetPos() - em:GetPos() ):Angle()
self.turret:SetRenderAngles( Angle( 0, ang.y - 180, self:GetAngles():Up() ) )
else
self.turret:SetRenderAngles( Angle( 0, 360 * math.sin( CurTime() * .5 ), 0 ) )
end
self.turret:DrawModel()
local eye = LocalPlayer():EyeAngles()
local Pos = self:LocalToWorld( self:OBBCenter() )+Vector( 0, 0, 35 )
local Ang = Angle( 0, eye.y - 90, 90 )
cam.Start3D2D(Pos + Vector( 0, 0, math.sin( CurTime() ) * 2 ), Ang, 0.1)
draw.SimpleText( self.turretTitle, "turretFontBig", 0, 0, Color( 170, 20, 20 ), 1, 1 )
draw.SimpleText( "Health: "..self:GetDTInt(1), "turretFont", 0, 25, color_white, 1, 1 )
draw.SimpleText( "Shots: "..self:GetDTInt(0), "turretFont", 0, 45, color_white, 1, 1 )
cam.End3D2D()
Any and all help would be really appreciated
Sorry, you need to Log In to post a reply to this thread.