Advertisement
Meliodas0_0

Vehicle Fly

Jul 26th, 2019
11,506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. lp = game:service'Players'.LocalPlayer
  2. uis = lp:GetMouse()
  3. uis.KeyDown:Connect(function(key)
  4. if key == 'W' or key == 'w' then
  5. W = true
  6. end
  7. end)
  8. uis.KeyUp:Connect(function(key)
  9. if key == 'W' or key == 'w' then
  10. W = false
  11. end
  12. end)
  13. lp = game:service'Players'.LocalPlayer.Character
  14. for i,v in pairs(workspace.Vehicles:GetDescendants()) do
  15. if v:IsA"StringValue" then
  16. if v.Value == game:service'Players'.LocalPlayer.Name then
  17. car = v.Parent.Parent
  18. end
  19. end
  20. end
  21. _G.Fly = game:service'RunService'.Stepped:Connect(function()
  22. if car then
  23. for i,v in pairs(car:GetDescendants()) do
  24. if v:IsA"BasePart" then
  25. v.Velocity = Vector3.new(0,0,0)
  26. end
  27. end
  28. end
  29. if W and car then
  30. for i,v in pairs(car:GetDescendants()) do
  31. if v:IsA"BasePart" then
  32. v.CFrame = v.CFrame + workspace.CurrentCamera.CFrame.LookVector*2.5
  33. end
  34. end
  35. end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement