Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. function DoNos ( Vehicle, VehTable, NosEff, StandPos, StandAng, NosPower )
  2. local nosSound = Sound("car/nos2.wav")
  3. Vehicle.Nos = {}
  4.  
  5. local Ang = Angle(0, 0, 90)
  6. local X = 20
  7. local Y = 80
  8. local Z = 10
  9. if VehTable.Model == "models/sentry/peelp50.mdl" then
  10. Ang = Angle(0, 0, 96)
  11. X = 300
  12. Y = 80
  13. Z = 20
  14. end
  15.  
  16.  
  17. if NosPower == 1 || NosPower == 3 then
  18. local nosM = ents.Create( "gmod_thruster" )
  19. nosM:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
  20. nosM:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
  21. nosM:SetPos( Vehicle:LocalToWorld(Vector(0, 80, 10)) )
  22. nosM:Spawn()
  23. nosM:SetSolid(SOLID_NONE);
  24. nosM:SetForce( 99999, 99999 )
  25. nosM:SetSound( nosSound )
  26. constraint.Weld( nosM, Vehicle, 0, 0, 0, true, true )
  27. table.insert(Vehicle.Nos, nosM)
  28. end
  29.  
  30. if NosPower == 2 || NosPower == 3 then
  31. local nosR = ents.Create( "gmod_thruster" )
  32. nosR:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
  33. nosR:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
  34. nosR:SetPos( Vehicle:LocalToWorld(Vector(-X, Y, Z)) )
  35. nosR:Spawn()
  36. nosR:SetSolid(SOLID_NONE);
  37. nosR:SetForce( 99999, 99999 )
  38. nosR:SetSound( nosSound )
  39. constraint.Weld( nosR, Vehicle, 0, 0, 0, true, true )
  40.  
  41. local nosL = ents.Create( "gmod_thruster" )
  42. nosL:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
  43. nosL:SetAngles( Vehicle:LocalToWorldAngles(Ang) )
  44. nosL:SetPos( Vehicle:LocalToWorld(Vector(X, Y, Z)) )
  45. nosL:Spawn()
  46. nosL:SetSolid(SOLID_NONE);
  47. nosL:SetForce( 99999, 99999 )
  48. nosL:SetSound( nosSound )
  49. constraint.Weld( nosL, Vehicle, 0, 0, 0, true, true )
  50.  
  51. table.insert(Vehicle.Nos, nosR)
  52. table.insert(Vehicle.Nos, nosL)
  53. end
  54.  
  55. for k, v in pairs(NosEff) do
  56. local nosE = ents.Create( "gmod_thruster" )
  57. nosE:SetModel( "models/props_phx2/garbage_metalcan001a.mdl" )
  58. nosE:SetAngles( Vehicle:LocalToWorldAngles(v[2]) )
  59. nosE:SetPos( Vehicle:LocalToWorld(v[1]) )
  60. nosE:Spawn()
  61. nosE:SetSolid(SOLID_NONE);
  62.  
  63. nosE:SetEffect( "plasma" )
  64. nosE:SetForce( 1, 1 )
  65. nosE:SetSound( "" )
  66. nosE.Effect = true
  67. constraint.Weld( nosE, Vehicle, 0, 0, 0, true, true )
  68. table.insert(Vehicle.Nos, nosE)
  69. end
  70.  
  71. StandAng = StandAng - Angle(10, 0, 0)
  72.  
  73. local nosStand = ents.Create("prop_physics")
  74. nosStand:SetPos(Vehicle:LocalToWorld(StandPos))
  75. nosStand:SetAngles( Vehicle:LocalToWorldAngles(StandAng) )
  76. nosStand:SetModel("models/sentry/nos.mdl")
  77. nosStand:Spawn()
  78. nosStand:SetParent(Vehicle)
  79. nosStand:SetColor(Color(math.random(0, 255), math.random(0, 255), math.random(0, 255), 255))
  80.  
  81. nosStand:SetSolid(SOLID_NONE)
  82. nosStand:SetMoveType(MOVETYPE_NONE)
  83. nosStand:SetCollisionGroup(COLLISION_GROUP_NONE)
  84. nosStand:GetPhysicsObject():Sleep()
  85. nosStand:GetPhysicsObject():EnableGravity(false)
  86. nosStand:GetPhysicsObject():EnableMotion(false)
  87. nosStand:GetPhysicsObject():EnableCollisions(false)
  88. nosStand:GetPhysicsObject():SetMass(0)
  89. nosStand:DrawShadow(false)
  90.  
  91. Vehicle.nosStand = nosStand
  92.  
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement