Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local noclipplayerx = game:GetService("Players").LocalPlayer
- local noclipmousex = noclipplayerx:GetMouse()
- local myname = game:GetService("Players").LocalPlayer.Character.Name
- local isfasting = "nope"
- local dir = 0
- noclipmousex.KeyDown:connect(function(key)
- if (key == "y") then
- if isfasting == "nope" then
- game.StarterGui:SetCore("ChatMakeSystemMessage", {
- Text = "Car Speed: ON",
- Color = Color3.new(0, 1, 0)
- })
- isfasting = "yeah"
- else
- isfasting = "nope"
- game.StarterGui:SetCore("ChatMakeSystemMessage", {
- Text = "Car Speed: OFF",
- Color = Color3.new(1, 0, 0)
- })
- end
- if isfasting ~= "yeah" then
- dir = 0
- else
- dir = 1
- gs = game.GetService
- val = {
- {Enum.KeyCode.W,1};
- {Enum.KeyCode.S,-1};
- }
- uis = gs(game,"UserInputService")
- chk = function(k)
- for i,v in next,val do
- if v[1]==k.KeyCode then
- return v[2]
- end
- end
- end
- uis.InputBegan:connect(function(k)
- dir = chk(k) or dir
- end)
- uis.InputEnded:connect(function(k)
- if chk(k) == dir then
- dir = 0
- end
- end)
- for i, v in pairs(game:GetService("Workspace").Vehicles:GetChildren()) do
- if (Vector3.new(v:GetPrimaryPartCFrame()) - Vector3.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position)).Magnitude < 50 then
- for ic, vc in pairs(v:GetChildren()) do
- for icx, vcx in pairs(vc:GetChildren()) do
- if vcx.Name == "PlayerName" then
- if vcx.Value == myname then
- --v:FindFirstChild("PassengerSeat").Position = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position)
- if v:FindFirstChild("Engine") then
- local bf,cf = v.Engine:FindFirstChild("NewForce"),v:GetPrimaryPartCFrame().lookVector
- if not bf then
- bf = v.Engine:FindFirstChild("BodyForce") or v.Engine:FindFirstChild("VectorForce")
- if bf then
- bf = bf:Clone()
- bf.Parent = v.Engine
- bf.Name = "NewForce"
- end
- end
- if bf then
- while vcx.Value == myname and isfasting == "yeah" do
- wait(0.2)
- cf=v:GetPrimaryPartCFrame().lookVector
- bf.Force = Vector3.new(cf.X*300000*dir,0,cf.Z*300000*dir)
- end
- if vcx.Value ~= myname then
- game.StarterGui:SetCore("ChatMakeSystemMessage", {
- Text = "Car Speed: OFF",
- Color = Color3.new(1, 0, 0)
- })
- isfasting = "nope"
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement