Advertisement
Guest User

Vehicle Simulator

a guest
Jun 25th, 2017
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local inftoggle = false
  3. function getvehicle()
  4. for i,v in pairs(game.Workspace.Vehicles:GetChildren()) do
  5. if v:IsA("Model") then
  6. if v.owner.Value == plr.Name then
  7. return v
  8. end
  9. end
  10. end
  11. return nil
  12. end
  13. function hint(txt, t)
  14. if t then
  15. local h = Instance.new("Hint",plr.PlayerGui)
  16. h.Text = txt
  17. wait(t)
  18. h:remove()
  19. else
  20. local h = Instance.new("Hint",plr.PlayerGui)
  21. h.Text = txt
  22. wait(2)
  23. h:remove()
  24. end
  25. end
  26.  
  27. plr.Chatted:connect(function(msg)
  28. if msg:lower():sub(1,10) == "/e toggle:" then
  29. local ins = msg:lower():sub(11)
  30. local vehicle = getvehicle()
  31. if vehicle then
  32. if ins == "infnitro" then
  33. if inftoggle == true then
  34. inftoggle = false
  35. hint("(-)Disabled Infinite Nitro!(-)")
  36. else
  37. inftoggle = true
  38. hint("(+)Enabled Infinite Nitro!(+)")
  39. end
  40. end
  41. else
  42. hint("(-)You do not have a vehicle spawned!(-)")
  43. end
  44. elseif msg:lower():sub(1,14) == "/e nitrospeed:" then
  45. local num = msg:sub(15)
  46. local vehicle = getvehicle()
  47. if vehicle then
  48. vehicle.Handling.Nitro.NitroSpeed.Value = tonumber(num)
  49. else
  50. hint("(-)You do not have a vehicle spawned!(-)")
  51. end
  52. elseif msg:lower():sub(1,14) == "/e nitroforce:" then
  53. local num = msg:sub(1,15)
  54. local vehicle = getvehicle()
  55. if vehicle then
  56. vehicle.Handling.Nitro.NitroForce.Value = tonumber(num)
  57. else
  58. hint("(-)You do not have a vehicle spawned!(-)")
  59. end
  60. elseif msg:lower():sub(1,12) == "/e maxspeed:" then
  61. local num = msg:sub(13)
  62. local vehicle = getvehicle()
  63. if vehicle then
  64. vehicle.Handling.MaxSpeed.Value = tonumber(num)
  65. else
  66. hint("(-)You do not have a vehicle spawned!(-)")
  67. end
  68. elseif msg:lower():sub(1,10) == "/e torque:" then
  69. local num = msg:sub(11)
  70. local vehicle = getvehicle()
  71. if vehicle then
  72. vehicle.Handling.Torque.Value = tonumber(num)
  73. else
  74. hint("(-)You do not have a vehicle spawned!(-)")
  75. end
  76. elseif msg:lower():sub(1,12) == "/e friction:" then
  77. local num = msg:sub(13)
  78. local vehicle = getvehicle()
  79. if vehicle then
  80. vehicle.Handling.FrictionOffroad.Value = tonumber(num)
  81. vehicle.Handling.FrictionRoad.Value = tonumber(num)
  82. else
  83. hint("(-)You do not have a vehicle spawned!(-)")
  84. end
  85. elseif msg:lower():sub(1,13) == "/e racingmode" then
  86. local vehicle = getvehicle()
  87. if vehicle then
  88. han = vehicle.Handling
  89. han.MaxSpeed.Value = 11000
  90. han.Torque.Value = 17000
  91. han.SteeringRadiusConstant.Value = 20000
  92. han.FrictionOffroad.Value = 200
  93. han.FrictionRoad.Value = 200
  94. han.Nitro.NitroSpeed.Value = 12000
  95. han.Nitro.NitroForce.Value = 35000
  96. inftoggle = true
  97. else
  98. hint("(-)You do not have a vehicle spawned!(-)")
  99. end
  100. end
  101. end)
  102. wait(0.5)
  103. while inftoggle == true do
  104. wait(0.02)
  105. local vehicle = getvehicle()
  106. if vehicle then
  107. vehicle.Handling.Nitro.NitroAmount.Value = 250
  108. end
  109. en
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement