proline69

2x CREDITS! Ultimate Driving

Apr 19th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. mouse = game:service'Players'.LocalPlayer:GetMouse()
  2. mouse.KeyDown:Connect(function(key)
  3. if key == "W" or key == "w" then
  4. for i,v in pairs(workspace["_Main"].Vehicles:GetDescendants()) do
  5. if v:IsA"VehicleSeat" then
  6. if v.Occupant == game:service'Players'.LocalPlayer.Character:FindFirstChildOfClass'Humanoid' then
  7. car = v.Parent
  8. car.PrimaryPart = car.Core.HitBox
  9. end
  10. end
  11. end
  12. W = true
  13. end
  14. end)
  15. mouse.KeyUp:Connect(function(key)
  16. if key == "W" or key == "w" then
  17. W = false
  18. end
  19. end)
  20. mouse.KeyDown:Connect(function(key)
  21. if key == "S" or key == "s" then
  22. S = true
  23. end
  24. end)
  25. mouse.KeyUp:Connect(function(key)
  26. if key == "S" or key == "s" then
  27. S = false
  28. end
  29. end)
  30. for i,v in pairs(workspace["_Main"].Vehicles:GetDescendants()) do
  31. if v:IsA"VehicleSeat" then
  32. if v.Occupant == game:service'Players'.LocalPlayer.Character:FindFirstChildOfClass'Humanoid' then
  33. car = v.Parent
  34. car.PrimaryPart = car.Core.HitBox
  35. end
  36. end
  37. end
  38. game:service'RunService'.Stepped:Connect(function()
  39. if W then
  40. for i,v in pairs(car:GetDescendants()) do
  41. if v:IsA"BasePart" then
  42. v.Velocity = v.Velocity*1.01
  43. end
  44. end
  45. end
  46. if S then
  47. for i,v in pairs(car:GetDescendants()) do
  48. if v:IsA"BasePart" then
  49. v.Velocity = v.Velocity*0.95
  50. end
  51. end
  52. end
  53. end)
Add Comment
Please, Sign In to add comment