Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local character = player.Character
- local humanoid = character:WaitForChild("Humanoid")
- character.Humanoid.WalkSpeed = 0
- speedgivin = 0
- Still = Vector3.new(0,0,0)
- idle = true
- idlewait = 120
- print(idlewait .. " < much seconds for to be afk")
- value = 0 + idlewait
- mouse.Button1Down:connect(function()
- character.Humanoid.WalkSpeed = 16
- while true do
- wait()
- if humanoid.Health > 0 then
- character["Humanoid"].WalkToPoint = Vector3.new(mouse.Hit.p.X, character.Torso.Position.Y, mouse.Hit.p.Z)
- elseif character.Humanoid.WalkSpeed < 16 then
- idlewait = 0
- local parts = character:GetChildren()
- for i,part in pairs(parts)do
- if part.ClassName == "ForceField" then
- part:Destroy()
- end
- end
- if character.Humanoid.WalkSpeed < 0 then
- idlewait = value
- idle = true
- end
- end
- if idlewait < 0 then
- idle = false
- end
- end
- end)
- mouse.Button1Up:connect(function()
- character.Humanoid.WalkSpeed = 0
- if idle == true or character.Humanoid.WalkSpeed < 0 then
- idlewait = value
- wait(idlewait)
- print('player has been idle')
- er = Instance.new("ForceField",character)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement