Advertisement
Nova355killer

car speed

Apr 13th, 2019
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. dir = 0
  2. gs = game.GetService
  3. gs(game,"RunService").RenderStepped:connect(function()
  4. for i,v in next,workspace.Vehicles:children() do
  5. if v.Name ~= "Heli" then
  6. if v:FindFirstChild("Engine") then
  7. local bf,cf = v.Engine:FindFirstChild("NewForce"),v:GetPrimaryPartCFrame().lookVector
  8. if not bf then
  9. bf = v.Engine:FindFirstChild("BodyForce") or v.Engine:FindFirstChild("VectorForce")
  10. if bf then
  11. bf = bf:Clone()
  12. bf.Parent = v.Engine
  13. bf.Name = "NewForce"
  14. end
  15. end
  16. if bf then
  17. local fa = 1
  18. if v.Name:lower():find("bike") then fa = .3 elseif v.Name:lower():find("bugg") then fa = .5 end
  19. if v.Seat.PlayerName.Value ~= game:GetService("Players").LocalPlayer.Name then fa = 0 end
  20. bf.Force = Vector3.new(cf.X*500000*dir*fa,0,cf.Z*500000*dir*fa)
  21. end
  22. end
  23. end
  24. end
  25. end)
  26. val = {
  27. {Enum.KeyCode.W,1};
  28. }
  29. uis = gs(game,"UserInputService")
  30. chk = function(k)
  31. for i,v in next,val do
  32. if v[1]==k.KeyCode then
  33. return v[2]
  34. end
  35. end
  36. end
  37. uis.InputBegan:connect(function(k)
  38. dir = chk(k) or dir
  39. end)
  40. uis.InputEnded:connect(function(k)
  41. if chk(k) == dir then
  42. dir = 0
  43. end
  44. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement