Advertisement
Guest User

speed

a guest
May 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. --[[
  2. Fully automatic money/miles farm
  3. TODO:
  4. Add auto respawn vehicle
  5. ]]
  6. local waitTime = 3 --This will be the time it takes (seconds) until your car resets. See line 37
  7. --Do not change anything below :)
  8. local hint = Instance.new('Hint', Workspace) hint.Text = "Vehicle Simulator Autofarm loading..."
  9. local found = false
  10. local go = true
  11.  
  12. function findVehicle() --Finds your vehicle
  13. while not found do --Loops until your vehicle has been found
  14. local vehicles = Workspace.Vehicles:getChildren()
  15. for i=1,#vehicles do
  16. if vehicles[i]:findFirstChild'owner' then
  17. if vehicles[i].owner.Value == game:GetService'Players'.LocalPlayer.Name then -- Found your vehicle
  18. found = true --Setting found to true so loop breaks
  19. vehicle = vehicles[i] -- Declares vehicle variable to your vehicle
  20. vehStats = vehicle.Handling -- Declares vehStats variable to vehicle stats folder
  21. vehStats.MaxSpeed.Value = 2000
  22. vehStats.Torque.Value = 120000
  23. vehStats.SteeringRadiusConstant.Value = 12090000
  24. elseif vehicles[i + 1] == nil and not found then
  25. --Autorespawn would go here
  26. hint.Text = "Please spawn and enter your vehicle!" --Your vehicle does not exist in the Workspace
  27. end
  28. end
  29. end
  30. wait(1) --Waiting before checking again so we don't crash
  31. end
  32. wait(2) --We've found the car. Waiting so the car can be properly placed on the highway
  33. vehicle.PrimaryPart = vehicle.Chassis.VehicleSeat
  34. end
  35. function farm() --This is where the magic happens :)
  36. hint.Text = "Finished loading! Autofarm initialized."
  37. while wait(waitTime) do --Waits x seconds before resetting car
  38. end
  39. end
  40. findVehicle() --Calls the findVehicle function
  41. while go do
  42. if not pcall(farm()) then --Calls farm function & checks for errors
  43. found = false --If it errors, it sets found to false and continues looking for your vehicle.
  44. findVehicle()
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement