Advertisement
TheRealAK47

Vehicle Sim miles

Dec 14th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. local waitTime = 2
  2. local found = false
  3. local go = true
  4.  
  5. function findVehicle() --Finds your vehicle
  6. while not found do --Loops until your vehicle has been found
  7. local vehicles = Workspace.Vehicles:getChildren()
  8. for i=1,#vehicles do
  9. if vehicles[i]:findFirstChild'owner' then
  10. if vehicles[i].owner.Value == game:GetService'Players'.LocalPlayer.Name then -- Found your vehicle
  11. found = true --Setting found to true so loop breaks
  12. vehicle = vehicles[i] -- Declares vehicle variable to your vehicle
  13. vehStats = vehicle.Handling -- Declares vehStats variable to vehicle stats folder
  14. vehStats.MaxSpeed.Value = 800
  15. vehStats.Torque.Value = 80000
  16. vehStats.SteeringRadiusConstant.Value = 120000000
  17. elseif vehicles[i + 1] == nil and not found then
  18. end
  19. end
  20. end
  21. wait(1)
  22. end
  23. wait(2)
  24. vehicle.PrimaryPart = vehicle.Chassis.VehicleSeat
  25. end
  26.  
  27. function farm()
  28. while wait(waitTime) do
  29. vehicle:SetPrimaryPartCFrame(CFrame.new(-2470,60,777))
  30. game:GetService'VirtualUser':SetKeyUp("w")
  31. game:GetService'VirtualUser':SetKeyDown("w")
  32. end
  33. end
  34. findVehicle()
  35. while go do
  36. if not pcall(farm()) then
  37. found = false
  38. findVehicle()
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement