Advertisement
cvrak

Untitled

Dec 9th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. down = false
  2. velocity = Instance.new("BodyVelocity")
  3. velocity.maxForce = Vector3.new(100000, 0, 100000)
  4. ---vv Use that to change the speed v
  5. local speed = 16
  6. gyro = Instance.new("BodyGyro")
  7. gyro.maxTorque = Vector3.new(100000, 0, 100000)
  8.  
  9. local hum = game.Players.LocalPlayer.Character.Humanoid
  10.  
  11. function onButton1Down(mouse)
  12. down = true
  13. velocity.Parent = game.Players.LocalPlayer.Character.UpperTorso
  14. velocity.velocity = (hum.MoveDirection) * speed
  15. gyro.Parent = game.Players.LocalPlayer.Character.UpperTorso
  16. while down do
  17. if not down then break end
  18. velocity.velocity = (hum.MoveDirection) * speed
  19. local refpos = gyro.Parent.Position + (gyro.Parent.Position - workspace.CurrentCamera.CoordinateFrame.p).unit * 5
  20. gyro.cframe = CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
  21. wait(0.1)
  22. end
  23. end
  24.  
  25. function onButton1Up(mouse)
  26. velocity.Parent = nil
  27. gyro.Parent = nil
  28. down = false
  29. end
  30. --To Change the key in those 2 lines, replace the "q" with your desired key
  31. function onSelected(mouse)
  32. mouse.KeyDown:connect(function(k) if k:lower()=="q"then onButton1Down(mouse)end end)
  33. mouse.KeyUp:connect(function(k) if k:lower()=="q"then onButton1Up(mouse)end end)
  34. end
  35.  
  36. onSelected(game.Players.LocalPlayer:GetMouse())
  37. Print "Hold Q for Speed the Ws is set to 16"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement