Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.38 KB | None | 0 0
  1. -- Farewell Infortality.
  2. -- Version: 2.82
  3. -- Instances:
  4. local ScreenGui = Instance.new("ScreenGui")
  5. local Main = Instance.new("Frame")
  6. local Credit = Instance.new("TextLabel")
  7. --Properties:
  8. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  9. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  10.  
  11. Main.Name = "Main"
  12. Main.Parent = ScreenGui
  13. Main.BackgroundColor3 = Color3.new(1, 1, 1)
  14. Main.Position = UDim2.new(0.636747599, 0, 0.19716087, 0)
  15. Main.Size = UDim2.new(0, 248, 0, 132)
  16. Main.Style = Enum.FrameStyle.DropShadow
  17. Main.Draggable = true
  18. Main.Active = true
  19.  
  20. Credit.Name = "Credit"
  21. Credit.Parent = Main
  22. Credit.BackgroundColor3 = Color3.new(0, 0, 0)
  23. Credit.Position = UDim2.new(-0.0134156747, 0, -0.0650523826, 0)
  24. Credit.Size = UDim2.new(0, 237, 0, 41)
  25. Credit.Font = Enum.Font.SourceSans
  26. Credit.Text = "Credit: Devil Script"
  27. Credit.TextColor3 = Color3.new(1, 0, 0.0156863)
  28. Credit.TextSize = 30
  29. -- Scripts:
  30.  
  31. --[[
  32. Fully automatic money/miles farm
  33. TODO:
  34. Add auto respawn vehicle
  35. ]]
  36. local waitTime = 3 --This will be the time it takes (seconds) until your car resets. See line 37
  37. --Do not change anything below :)
  38. local hint = Instance.new('Hint', Workspace) hint.Text = "Vehicle Simulator Autofarm loading..."
  39. local found = false
  40. local go = true
  41.  
  42. function findVehicle() --Finds your vehicle
  43.     while not found do --Loops until your vehicle has been found
  44.         local vehicles = Workspace.Vehicles:getChildren()
  45.         for i=1,#vehicles do
  46.             if vehicles[i]:findFirstChild'owner' then
  47.                 if vehicles[i].owner.Value == game:GetService'Players'.LocalPlayer.Name then -- Found your vehicle
  48.                     found                                 = true --Setting found to true so loop breaks
  49.                     vehicle                               = vehicles[i] -- Declares vehicle variable to your vehicle
  50.                     vehStats                              = vehicle.Handling -- Declares vehStats variable to vehicle stats folder
  51.                     vehStats.MaxSpeed.Value               = 700
  52.                     vehStats.Torque.Value                 = 30000
  53.                     vehStats.SteeringRadiusConstant.Value = 120000000
  54.                 elseif vehicles[i + 1] == nil and not found then
  55.                     --Autorespawn would go here
  56.                     hint.Text = "Please spawn and enter your vehicle!" --Your vehicle does not exist in the Workspace
  57.                 end
  58.             end
  59.         end
  60.         wait(1) --Waiting before checking again so we don't crash
  61.     end
  62.     wait(2) --We've found the car. Waiting so the car can be properly placed on the highway
  63.     vehicle.PrimaryPart = vehicle.Chassis.VehicleSeat
  64. end
  65.  
  66. function farm() --This is where the magic happens :)
  67.     hint.Text = "Finished loading! Autofarm initialized."
  68.     while wait(waitTime) do --Waits x seconds before resetting car
  69.         vehicle:SetPrimaryPartCFrame(CFrame.new(-2470,60,777)) --Teleports vehicle to highway
  70.         game:GetService'VirtualUser':SetKeyUp("w") --Resets W key
  71.         game:GetService'VirtualUser':SetKeyDown("w") --Presses W key to go forward
  72.     end
  73. end
  74. findVehicle() --Calls the findVehicle function
  75. while go do
  76.     if not pcall(farm()) then --Calls farm function & checks for errors
  77.        found = false  --If it errors, it sets found to false and continues looking for your vehicle.
  78.        findVehicle()
  79.    end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement