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

Is there a way to find if there is an idle player? [closed]

Asked by 10 years ago

I could make a script that could find out when the idle animation plays, but It doesn't work. There is a way to see if there is an idle player but It checks for players that have been idle for 2 min. How could you change it to 5 seconds instead of 2 min?

1game.Players.Player.Idled:connect(function(time)
2     print("Player has been idle for " .. time .. " seconds")
3end)
0
You could write your own custom event using ticks and UserInputService. DigitalVeer 1473 — 10y

Locked by JesseSong, Void_Frost, and youtubemasterWOW

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
5
Answered by 9 years ago

Yes there is a way, I don't feel like scripting it but make a mouse move script that resets a counter the counter goes up every seconds and after a certain amount it goes to idle mode. This value aka the seconds idled should be reset by keydown and moved all mouse functions. So relatively easy.

Example

01local player = game.Players.LocalPlayer
02repeat wait() until player.Character
03local mouse = player:GetMouse()
04local seconds = script.Parent.Parent.Seconds
05function moved()
06seconds.Value = 0
07end
08 
09function down()
10seconds.Value = 0
11end
12 
13mouse.KeyDown:connect(down)
14mouse.Moved:connect(moved)

Inside the seconds there should be

1while true do
2wait()
3if seconds.Value<60 then
4seconds.Value=seconds.Value+1
5wait(1)
6end
7 
8end
Ad
Log in to vote
0
Answered by 10 years ago

Sadly no, if you look at the Roblox Wiki page for this event, then you'll see that the only duration is every two minutes. Sorry about that.

0
I got the script from the wiki. I already know It takes 2 min that's why I asked it. EzraNehemiah_TF2 3552 — 10y
0
And I answered. Your question was "Is there a way to find if there is an idle player?" the answer (besides what you pointed out) is no Norshine 88 — 10y