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?

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

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

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local mouse = player:GetMouse()
local seconds = script.Parent.Parent.Seconds
function moved() 
seconds.Value = 0
end

function down()
seconds.Value = 0
end

mouse.KeyDown:connect(down)
mouse.Moved:connect(moved)

Inside the seconds there should be

while true do
wait()
if seconds.Value<60 then
seconds.Value=seconds.Value+1
wait(1)
end

end
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