How do I create a script where I can make an auto rejoin thing like Combat Warriors Premium AFK?
COMMUNITY QUESTION
How to make Auto rejoin during AFK periods?
1 answer
A simple solution can be found utilizing the Player.Idled event. It fires (I believe roughly every two minutes don't quote me) when the player is idle and passes how many seconds they have been idle. If they have been idle for say, greater than 14 minutes, we re-join them to bypass the 20 minute limit.
(RunContext Server of course)
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
Players.PlayerAdded:Connect(function(Player)
Player.Idled:Connect(function(TimeIdle)
if TimeIdle > 840 then
TeleportService:TeleportAsync(game.PlaceId, {Player})
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
wdym by afk periods?
like when im afk
make the player teleport to the game