Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Idled Player script help please?[STILL UNANSWERED]

Asked by 10 years ago

I got this script from the wiki but it takes 2 minutes for the function to run, How could you make the time change to 5 seconds or so?

game.Players.Player.Idled:connect(function(time)
     print("Player has been idle for " .. time .. " seconds")
end)

1 answer

Log in to vote
-2
Answered by 10 years ago

Maybe try getting it when they're walk speed hits 0 then keep adding time to a variable called idleTime. Maybe try this:

idleTime = 0

character = game.Players.Player.Character
character.Humanoid.WalkSpeed.Changed:connect(function ()
    if character.Humanoid.WalkSpeed == 0 then
        while character.Humanoid.WalkSpeed == 0 do
            wait(1)
            idleTime = idleTime + 1
            print("Player has been idle for "..idleTime.." seconds")
        end
    end
end)
1
That isn't going to work if the character walkspeed is always 16. EzraNehemiah_TF2 3552 — 10y
0
Oh woops I believe there is a way to tell when the player is and isn't walking though legobuildermaster 220 — 10y
Ad

Answer this question