UsernameRTX

Driving Simulator Simple Auto-farm!

Apr 20th, 2021 (edited)
3,022
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local RunService = game:GetService("RunService")
  2. local Players = game:GetService("Players")
  3.  
  4. local LocalPlayer = Players.LocalPlayer
  5. local Vehicle = (function()
  6.     for Number, Instance2 in pairs(workspace["$cars"]:GetChildren()) do
  7.         if Instance2.State.Owner.Value == LocalPlayer then
  8.             return Instance2
  9.         end
  10.     end
  11. end)()
  12. local GetNitro = (function()
  13.     for Number, Function in pairs(getgc()) do
  14.         if typeof(Function) == "function" and debug.getinfo(Function).name == "GetNitro" then
  15.             return Function
  16.         end
  17.     end
  18. end)()
  19. hookfunction(GetNitro, function()
  20.     return true
  21. end)
  22.  
  23. local Part = Instance.new("Part")
  24. Part.CFrame = CFrame.new(0, -50, 0)
  25. Part.Anchored = true
  26. Part.Size = Vector3.new(Vehicle.Body.PrimaryBody.Size.X, 1, 2048)
  27. Part.Parent = workspace
  28. local SizeZ = Part.Size.Z
  29.  
  30. Vehicle:SetPrimaryPartCFrame(Part.CFrame + Vector3.new(0, Part.Size.Y / 2, SizeZ / 2 - Vehicle.Body.PrimaryBody.Size.Z / 2))
  31. RunService.RenderStepped:Connect(function()
  32.     if Part.CFrame:ToObjectSpace(Vehicle.RootPart.CFrame).Z < -SizeZ / 2 then
  33.         Vehicle:SetPrimaryPartCFrame(Part.CFrame + Vector3.new(0, Part.Size.Y / 2, SizeZ / 2 - Vehicle.Body.PrimaryBody.Size.Z / 2))
  34.     end
  35. end)
RAW Paste Data