Advertisement
Delros12

aim character at mouse

Jan 1st, 2019 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. local UIS = game:GetService("UserInputService")
  4. local mouse = player:GetMouse()
  5. local char = player.Character
  6.  
  7. local stabilize = Instance.new("BodyGyro", char.HumanoidRootPart)
  8. stabilize.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  9. stabilize.P = 100000
  10.  
  11. local enabled = false
  12. mouse.KeyDown:connect(function(key) if key == "r" then enabled = not enabled end end)
  13.  
  14. while wait() do
  15. if enabled == true then
  16. stabilize.CFrame = CFrame.new(char.HumanoidRootPart.CFrame.p, mouse.Hit.p)
  17. stabilize.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  18. else
  19. stabilize.MaxTorque = Vector3.new(0, 0, 0)
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement