Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:Initialize()
- self:SetModel( "models/naval/hedgehog_launcher.mdl" )
- self:SetAngles( Angle ( 0, 0, 0 ))
- self:PhysicsInit( SOLID_VPHYSICS )
- self:SetMoveType( MOVETYPE_VPHYSICS )
- self:SetSolid( SOLID_VPHYSICS )
- self.Inputs = WireLib.CreateSpecialInputs(self, {"Fire","Reload"}, {"NORMAL","NORMAL"})
- local bombPositions = {Vector( 58.6445, 31.2136, 19.7565 ) , Vector(41.8027, 31.5862, 20.5107 ) , Vector( 24.9608, 31.9587, 21.265 ) , Vector( 8.1189, 32.3313, 22.0192 ) , Vector( -8.723, 32.7038, 22.7735 ) , Vector(-25.5648, 33.0764, 23.5278 ) , Vector( 58.6445, 11.3196, 19.7565 ) , Vector(41.8027, 11.6922, 20.5107 ) , Vector(24.9608, 12.0647, 21.265 ) , Vector(8.1189, 12.4372, 22.0192 ) , Vector(-8.723, 12.8098, 22.7735 ) , Vector(-25.5648, 13.3965, 23.5278 ) , Vector( 58.6445, -10.4592, 19.7565 ) , Vector(41.8027, -10.7572, 20.5107 ) , Vector(24.9608, -11.3533, 21.265 ) , Vector(8.1189, -12.0239, 22.0192 ) , Vector(-8.723, -12.5901, 22.7735 ) , Vector(-25.5648, -13.3965, 23.5278 ) , Vector( 58.6445, -30.5651, 19.7565 ) , Vector(41.8027, -30.8632, 20.5107 ) , Vector(24.9608, -31.4593, 21.265 ) , Vector(8.1189, -32.1298, 22.0192 ) , Vector(-8.723, -32.6961, 22.7735 ) , Vector(-25.5648, -33.2905, 23.5278 ) } // Introduce all the positions here replacing the a b c for the actual numbers.
- local phys = self:GetPhysicsObject()
- if (phys:IsValid()) then
- phys:Wake()
- end
- end
- function ENT:Use( activator, caller )
- return
- end
- function ENT:Think()
- function self:TriggerInput(iname, value)
- if (iname == "Fire") then
- for k, v in pairs( ents.FindByModel( "models/naval/hedgehog.mdl" ) ) do
- if math.Distance( self:GetPos().x, self:GetPos().y, v:GetPos().x, v:GetPos().y ) < 80 then
- v:Remove()
- self.fire = value
- elseif (iname == "Reload") then
- self.Reload = value
- for i=1, 24 do
- local ent = ents.Create("prop_physics")
- ent:SetModel( "models/naval/hedgehog.mdl" )
- ent:SetMoveType( MOVETYPE_VPHYSICS )
- ent:PhysicsInit( SOLID_VPHYSICS )
- ent:SetSolid( SOLID_VPHYSICS )
- ent:Spawn()
- ent:SetLocalPos( Vector(bombPositions[i]) )
- local p, y
- p = -( 45 - 5 * (i - 1) + (30 * (math.ceil(i/6)-1)))
- if i <= 6 then
- y = ( 2 * i + 1.5 )
- elseif i <= 12 then
- y = (( 2 * i + 0.5 ) - 6 * 2 )
- elseif i <= 18 then
- y =-(( 2 * i + 0.5 ) - 12 * 2)
- elseif i <= 24 then
- y =-(( 2 * i + 1.5) - 18 * 2)
- end
- r = ( 0 )
- ent:SetParent(self, -1)
- end
- end end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement