NekoWaifu

Untitled

Apr 14th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. -- << K1LL0X >> --
  2.  
  3. --This may be a little buggy, so beware.
  4. --Hold "Q" to speed up
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. down = false
  12. velocity = Instance.new("BodyVelocity")
  13. velocity.maxForce = Vector3.new(100000, 0, 100000)
  14. local speed = 150
  15. gyro = Instance.new("BodyGyro")
  16. gyro.maxTorque = Vector3.new(100000, 0, 100000)
  17.  
  18. local hum = game.Players.LocalPlayer.Character.Humanoid
  19.  
  20. function onButton1Down(mouse)
  21. down = true
  22. velocity.Parent = game.Players.LocalPlayer.Character.UpperTorso
  23. velocity.velocity = (hum.MoveDirection) * speed
  24. gyro.Parent = game.Players.LocalPlayer.Character.UpperTorso
  25. while down do
  26. if not down then break end
  27. velocity.velocity = (hum.MoveDirection) * speed
  28. local refpos = gyro.Parent.Position + (gyro.Parent.Position - workspace.CurrentCamera.CoordinateFrame.p).unit * 5
  29. gyro.cframe = CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
  30. wait(0.1)
  31. end
  32. end
  33.  
  34. function onButton1Up(mouse)
  35. velocity.Parent = nil
  36. gyro.Parent = nil
  37. down = false
  38. end
  39.  
  40. function onSelected(mouse)
  41. mouse.KeyDown:connect(function(k) if k:lower()=="q"then onButton1Down(mouse)end end)
  42. mouse.KeyUp:connect(function(k) if k:lower()=="q"then onButton1Up(mouse)end end)
  43. end
  44.  
  45. onSelected(game.Players.LocalPlayer:GetMouse())
Add Comment
Please, Sign In to add comment