Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DoNos ( Vehicle, VehTable, NosEff, StandPos, StandAng, NosPower )
- local nosSound = Sound("car/nos2.wav")
- Vehicle.Nos = {}
- local Ang = Angle(0, 0, 90)
- local X = 20
- local Y = 80
- local Z = 10
- if VehTable.Model == "models/sentry/peelp50.mdl" then
- Ang = Angle(0, 0, 96)
- X = 300
- Y = 80
- Z = 20
- end
- if NosPower == 1 || NosPower == 3 then
- local nosM = ents.Create( "gmod_thruster" )
- nosM:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
- nosM:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
- nosM:SetPos( Vehicle:LocalToWorld(Vector(0, 80, 10)) )
- nosM:Spawn()
- nosM:SetSolid(SOLID_NONE);
- nosM:SetForce( 99999, 99999 )
- nosM:SetSound( nosSound )
- constraint.Weld( nosM, Vehicle, 0, 0, 0, true, true )
- table.insert(Vehicle.Nos, nosM)
- end
- if NosPower == 2 || NosPower == 3 then
- local nosR = ents.Create( "gmod_thruster" )
- nosR:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
- nosR:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
- nosR:SetPos( Vehicle:LocalToWorld(Vector(-X, Y, Z)) )
- nosR:Spawn()
- nosR:SetSolid(SOLID_NONE);
- nosR:SetForce( 99999, 99999 )
- nosR:SetSound( nosSound )
- constraint.Weld( nosR, Vehicle, 0, 0, 0, true, true )
- local nosL = ents.Create( "gmod_thruster" )
- nosL:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
- nosL:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
- nosL:SetPos( Vehicle:LocalToWorld(Vector(X, Y, Z)) )
- nosL:Spawn()
- nosL:SetSolid(SOLID_NONE);
- nosL:SetForce( 99999, 99999 )
- nosL:SetSound( nosSound )
- constraint.Weld( nosL, Vehicle, 0, 0, 0, true, true )
- table.insert(Vehicle.Nos, nosR)
- table.insert(Vehicle.Nos, nosL)
- end
- for k, v in pairs(NosEff) do
- local nosE = ents.Create( "gmod_thruster" )
- nosE:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
- nosE:SetAngles( Vehicle:LocalToWorldAngles(v[2]) )
- nosE:SetPos( Vehicle:LocalToWorld(v[1]) )
- nosE:Spawn()
- nosE:SetSolid(SOLID_NONE);
- nosE:SetEffect( "plasma" )
- nosE:SetForce( 1, 1 )
- nosE:SetSound( "" )
- nosE.Effect = true
- constraint.Weld( nosE, Vehicle, 0, 0, 0, true, true )
- table.insert(Vehicle.Nos, nosE)
- end
- StandAng = StandAng - Angle(10, 0, 0)
- local nosStand = ents.Create("prop_physics")
- nosStand:SetPos(Vehicle:LocalToWorld(StandPos))
- nosStand:SetAngles( Vehicle:LocalToWorldAngles(StandAng) )
- nosStand:SetModel("models/sentry/nos.mdl")
- nosStand:Spawn()
- nosStand:SetParent(Vehicle)
- nosStand:SetColor(Color(math.random(0, 255), math.random(0, 255), math.random(0, 255), 255))
- nosStand:SetSolid(SOLID_NONE)
- nosStand:SetMoveType(MOVETYPE_NONE)
- nosStand:SetCollisionGroup(COLLISION_GROUP_NONE)
- nosStand:GetPhysicsObject():Sleep()
- nosStand:GetPhysicsObject():EnableGravity(false)
- nosStand:GetPhysicsObject():EnableMotion(false)
- nosStand:GetPhysicsObject():EnableCollisions(false)
- nosStand:GetPhysicsObject():SetMass(0)
- nosStand:DrawShadow(false)
- Vehicle.nosStand = nosStand
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement