UsernameRTX

Mediocre Auto-farm!

Apr 20th, 2021 (edited)
92,782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2. local CoreGui = game:GetService("CoreGui")
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4. local Debris = game:GetService("Debris")
  5. local HttpService = game:GetService("HttpService")
  6. local RunService = game:GetService("RunService")
  7.  
  8. local LocalPlayer = Players.LocalPlayer
  9.  
  10. local src = ReplicatedStorage.src
  11. local pcar = src.pcar
  12.  
  13. local CarInput = require(pcar.CarInput)
  14. local CarPlacer = require(pcar.CarPlacer)
  15. local CarTracker = require(pcar.CarTracker)
  16. local ClientCarState = require(pcar.ClientCarState)
  17.  
  18. if not ClientCarState.isDriving then
  19.     local Hint = Instance.new("Hint")
  20.     Hint.Name = HttpService:GenerateGUID(true)
  21.     Hint.Text = "Please, Spawn/Enter Your Car (Before Executing)!"
  22.     Hint.Parent = CoreGui
  23.     Debris:AddItem(Hint, 5)
  24.     return
  25. end
  26.  
  27. local ResetVelocity = function(Model)
  28.     for _, Value in pairs(Model:GetDescendants()) do
  29.         if Value:IsA("BasePart") then
  30.             Value.Velocity = Vector3.new()
  31.             Value.RotVelocity = Vector3.new()
  32.         end
  33.     end
  34.     return
  35. end
  36.  
  37. hookfunction(CarInput.GetNitro, function()
  38.     return true
  39. end)
  40.  
  41. local _, Size = CarTracker.getCarFromDriver(LocalPlayer):GetBoundingBox()
  42.  
  43. local Part = Instance.new("Part")
  44. Part.Name = HttpService:GenerateGUID(true)
  45. Part.CFrame = CFrame.new(0, -50, 0)
  46. Part.Anchored = true
  47. Part.Size = Vector3.new(Size.X, 1, 2048)
  48. Part.Parent = workspace
  49.  
  50. ResetVelocity(CarTracker.getCarFromDriver(LocalPlayer))
  51. CarPlacer.place(nil, CarTracker.getCarFromDriver(LocalPlayer), Part.CFrame + Vector3.new(0, Part.Size.Y / 2 + Size.Y / 2, Part.Size.Z / 2 - Size.Z / 2))
  52. RunService.RenderStepped:Connect(function()
  53.     local CFramenew, _ = CarTracker.getCarFromDriver(LocalPlayer):GetBoundingBox()
  54.     if Part.CFrame:ToObjectSpace(CFramenew).Z < -Part.Size.Z / 2 + Size.Z / 2 then
  55.         CarPlacer.place(nil, CarTracker.getCarFromDriver(LocalPlayer), Part.CFrame + Vector3.new(0, Part.Size.Y / 2 + Size.Y / 2, Part.Size.Z / 2 - Size.Z / 2))
  56.     end
  57. end)
  58. print("Script Executed!")
Add Comment
Please, Sign In to add comment