Advertisement
Animescapetower

Walking controlled mouse [VOID]

May 24th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local mouse = player:GetMouse()
  3. local character = player.Character
  4. local humanoid = character:WaitForChild("Humanoid")
  5. character.Humanoid.WalkSpeed = 0
  6.  
  7. speedgivin = 0
  8. Still = Vector3.new(0,0,0)
  9. idle = true
  10.  
  11.  
  12. idlewait = 120
  13. print(idlewait .. " < much seconds for to be afk")
  14. value = 0 + idlewait
  15. mouse.Button1Down:connect(function()
  16. character.Humanoid.WalkSpeed = 16
  17.  
  18. while true do
  19. wait()
  20.  
  21. if humanoid.Health > 0 then
  22. character["Humanoid"].WalkToPoint = Vector3.new(mouse.Hit.p.X, character.Torso.Position.Y, mouse.Hit.p.Z)
  23.  
  24.  
  25.  
  26. elseif character.Humanoid.WalkSpeed < 16 then
  27. idlewait = 0
  28. local parts = character:GetChildren()
  29. for i,part in pairs(parts)do
  30. if part.ClassName == "ForceField" then
  31. part:Destroy()
  32. end
  33. end
  34. if character.Humanoid.WalkSpeed < 0 then
  35. idlewait = value
  36. idle = true
  37. end
  38.  
  39. end
  40. if idlewait < 0 then
  41. idle = false
  42. end
  43.  
  44.  
  45.  
  46. end
  47. end)
  48.  
  49.  
  50. mouse.Button1Up:connect(function()
  51.  
  52.  
  53. character.Humanoid.WalkSpeed = 0
  54. if idle == true or character.Humanoid.WalkSpeed < 0 then
  55. idlewait = value
  56. wait(idlewait)
  57. print('player has been idle')
  58. er = Instance.new("ForceField",character)
  59. end
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement