Make 1 player afk in a round based game with a script not a local script

I have made a round based game the script works and it is flexible. But the script is a Script not a local script and I want to make it possible for the player to go afk. I was hoping I could add a check before all the code for the round happens and if the player is afk then don’t teleport the player to the round. But since the script is a Script and not a local script it will make none of the players teleport it one player is afk.

I have looked this up but the topic is a interesting one so I couldn’t find anything

If you need me to show you the script I can but it is vary large and complicated, and might be a little hard to read.

If you have any idea what I could do help would be appreciated

check whether they are idle in InputService like this:

local UIS = game:GetService("UserInputService")
local idling = false
local idletime = 0

UIS.InputBegan:Connect(function()
    idling = false
    idletime = 0
end)

UIS.InputEnded:Connect(function()
    idling = true
end)

while wait(1)
    if idling then
        idletime += 1
    end
end

and to not teleport them if they are idle, just use something like this:

local maxtime = 180 --how much time
if idletime < maxtime then
    --teleport them
end

So I don’t need to know if they are idle, I want them to click a button like in epic minigames to say they are afk. The problem is that if I use a script on the server to do the rounds but I want the 1 player that is afk to not teleport. But thanks anyways

oh, if thats the case, when the play clicks the textbutton, have it fire a remote event and add them into a idle table. When you teleport, make sure to check whether they are in the idle table or not.

Ok thankyou, do you know somewhere I could go to learn more about remote events i find myself a little rusty with them I haven’t needed them until now.

Here is an article about them.