I have written a script in charge of teleporting players to a place in this “universe”. However, I just implemented an AFK system and need help on how to go about writing a code.
Currently, the GUI that lets you go AFK changes a value in the Player (not character, just player) to true, (the value is called AFK)
Here is the current version of the script:
while wait(60) do
local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TS:ReserveServer(6695412415)
local players = Players:GetPlayers()
TS:TeleportToPrivateServer(6695412415, code, players)
end
I have a feeling it has something to do with in pairs, but I have no clue what any of the tutorials mean. How would I go about implementing this?
Also, here’s a clip of the game prior to right now: