Advertisement
Guest User

Auto Farm Vehicle Simulator!!!

a guest
Apr 24th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. local waitTime = 3
  2. local hint = Instance.new('Hint', Workspace) hint.Text = "Kalem Auto Farm Na Keur Loading"
  3. local found = false
  4. local go = true
  5.  
  6. function findVehicle() --Finds your vehicle
  7. while not found do --Loops until your vehicle has been found
  8. local vehicles = Workspace.Vehicles:getChildren()
  9. for i=1,#vehicles do
  10. if vehicles[i]:findFirstChild'owner' then
  11. if vehicles[i].owner.Value == game:GetService'Players'.LocalPlayer.Name then -- Found your vehicle
  12. found = true --Setting found to true so loop breaks
  13. vehicle = vehicles[i] -- Declares vehicle variable to your vehicle
  14. vehStats = vehicle.Handling -- Declares vehStats variable to vehicle stats folder
  15. vehStats.MaxSpeed.Value = 1000
  16. vehStats.Torque.Value = 100000
  17. vehStats.SteeringRadiusConstant.Value = 120000000
  18. elseif vehicles[i + 1] == nil and not found then
  19. --Autorespawn would go here
  20. hint.Text = "Spawn Mobil Sia Langsung Asup Kana Mobil Sia!" --Your vehicle does not exist in the Workspace
  21. end
  22. end
  23. end
  24. wait(1)
  25. end
  26. wait(2)
  27. vehicle.PrimaryPart = vehicle.Chassis.VehicleSeat
  28. end
  29.  
  30. function farm() --This is where the magic happens :)
  31. hint.Text = "Aditya Bima Nugraha Gans FB : AdityaMpuss"
  32. while wait(waitTime) do --Waits x seconds before resetting car
  33. vehicle:SetPrimaryPartCFrame(CFrame.new(-2470,60,777))
  34. game:GetService'VirtualUser':SetKeyUp("w") --Resets W key
  35. game:GetService'VirtualUser':SetKeyDown("w") --Presses W key to go forward
  36. end
  37. end
  38. findVehicle()
  39. while go do
  40. if not pcall(farm()) then
  41. found = false
  42. findVehicle()
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement