Advertisement
Lancere

afk400mph

May 10th, 2021
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local TweenService = game:GetService("TweenService")
  5.  
  6. local LocalPlayer = Players.LocalPlayer
  7. local Character = LocalPlayer.Character
  8. local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
  9.  
  10. local SeatPart = Humanoid.SeatPart
  11. local Vehicle = SeatPart.Parent
  12. local Wheels = Vehicle:FindFirstChild("Wheels")
  13. local Body = Vehicle:FindFirstChild("Body")
  14.  
  15. if SeatPart:FindFirstAncestor("Body") then
  16. Vehicle = SeatPart:FindFirstAncestor("Body").Parent
  17. Wheels = (Wheels ~= nil and Wheels) or Vehicle:FindFirstChild("Wheels")
  18. end
  19.  
  20. if game.PlaceId == 3351674303 then
  21. Wheels = Vehicle:FindFirstChild("Core")
  22. end
  23.  
  24. Vehicle.PrimaryPart = SeatPart
  25.  
  26. local function GetWheelVelocity()
  27. if game.PlaceId == 3351674303 then
  28. return Wheels:GetChildren()[1]["Wheel"].Velocity, Wheels:GetChildren()[1]["Wheel"].RotVelocity
  29. end
  30. for index, value in pairs(Wheels:GetDescendants()) do
  31. if value:IsA("BasePart") then
  32. return value.Velocity, value.RotVelocity
  33. end
  34. end
  35. end
  36.  
  37. local function SetWheelVelocity(Velocity, RotVelocity)
  38. for index, value in pairs(Wheels:GetDescendants()) do
  39. pcall(function()
  40. value.Velocity = Velocity
  41. if RotVelocity ~= nil then
  42. value.RotVelocity = RotVelocity
  43. end
  44. end)
  45. end
  46. end
  47. Connection = game:GetService("RunService").Stepped:Connect(function()
  48. if not Vehicle or not Vehicle.Parent or not Humanoid.SeatPart then
  49. Connection:Disconnect()
  50. return
  51. end
  52. local Speed = ((10/12) * (60/88)) * SeatPart.Velocity.Magnitude
  53. if SeatPart.Position.X > -14294.7607 then
  54. Character.Parent = Vehicle
  55. Vehicle:MoveTo(Vector3.new(-17157.2793, 83.1872673, 2641.22705))
  56. Character.Parent = workspace
  57. end
  58. if Speed < 550 then --If your car goes faster than 550, change it to something bigger. Otherwise, leave it alone.
  59. local WV = GetWheelVelocity()
  60. SetWheelVelocity(Vector3.new(802, WV["Y"], 802 / -50.1940043308)) --Change the "635"s to whatever number you need.
  61. end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement