IamSourFish

Roblox Vehicle Simulator Gui

Jan 27th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.84 KB | None | 0 0
  1. local waitTime = 3
  2. local hint = Instance.new('Hint', Workspace) hint.Text = "Auto Farm Is Loading... Improved and Updated by UbiquitousGaming"
  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 = 800
  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 = "Please spawn and enter your vehicle!" --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 = "Auto Farm Fully Initialized. Improved and Updated by UbiquitousGaming"
  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