Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make Auto rejoin during AFK periods?

How do I create a script where I can make an auto rejoin thing like Combat Warriors Premium AFK?

3 comments

0

wdym by afk periods?

0

like when im afk

0

make the player teleport to the game

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.