Advertisement
FlyFar

OP Driving Empire Auto Farm (Lua)

Jun 5th, 2023
3,118
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | Cybersecurity | 0 1
  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.  
  48. game:GetService("StarterGui"):SetCore("SendNotification", {
  49. Title = "Driving Empire Autofarm:Edited by Lancere#1521",
  50. Text = "Thank you for using, if you have any ideas &/or suggestions please message me @ shawnjbragdon#0001 on discord.",
  51. Duration = 30,
  52. Button1 = "Continue",
  53. })
  54.  
  55. game:GetService("StarterGui"):SetCore("SendNotification", {
  56. Title = "Continuation",
  57. Text = "If you need help with setting the speed and whatnot, send me a dm Lancere#1521.",
  58. Duration = 30,
  59. Button1 = "Ight",
  60. })
  61.  
  62. Connection = game:GetService("RunService").Stepped:Connect(function()
  63. if not Vehicle or not Vehicle.Parent or not Humanoid.SeatPart then
  64. Connection:Disconnect()
  65. return
  66. end
  67. local Speed = ((10/12) * (60/88)) * SeatPart.Velocity.Magnitude
  68. if SeatPart.Position.X > -14294.7607 then
  69. Character.Parent = Vehicle
  70. Vehicle:MoveTo(Vector3.new(-17157.2793, 43.1872673, 2611.22705))
  71. Character.Parent = workspace
  72. end
  73. if Speed < 550 then --If your car goes faster than 550, change it to something bigger. Otherwise, leave it alone.
  74. local WV = GetWheelVelocity()
  75. SetWheelVelocity(Vector3.new(635, WV["Y"], 635 / -29.1940043308)) --Change the "635"s to whatever number you need.
  76. end
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement