This script checks to see if the palyer's afk value is true or not and teleports them if true, except it breaks the script if it's true and has no error output
Spawns = game.Workspace:WaitForChild("Spawns") --Waits for the Spawns to become available.
Players = game.Players:GetPlayers() --Define players
for PlayerTeleport = 1, #Players do
if Players[PlayerTeleport]:WaitForChild("AFK").Value == true then --Waits for the AFK value and then checks if it's true.
local char = Players[PlayerTeleport].CharacterAdded:wait() --Essentially waits for the CharacterAdded event to fire, then returns the character.
char:WaitForChild("Torso").CFrame = Spawns[_G.StartingPlaces[math.random(1,#_G.StartingPlaces)]].CFrame * CFrame.new(0,8,0) --Waits for the torso to become available before teleporting.
end
end

1 comment
Is Spawns on line 1 a varaible?