I have the script to where it puts a boolian in the player but I need to check if the players value is true or not then teleport the player if false. Idk the proper way of doing this. leik?
The only thing that's erroring is :GetChildren()
error: Value is not a valid member of Camera
Spawns = game.Workspace.Spawns
Players = game.Players:GetChildren()
AFKCheck = game.Workspace:GetChildren()
for PlayerTeleport = 1, #Players do
if game.Workspace:FindFirstChild(Players[PlayerTeleport].Name) then
if AFKCheck[PlayerTeleport].Value == false then
Players[PlayerTeleport].Character.Torso.CFrame = Spawns[_G.StartingPlaces[math.random(1,#_G.StartingPlaces)]].CFrame * CFrame.new(0,8,0)
else
end
end
end

8 comments
I've never used ipairs, how would this fit into the script?
SwaggyDuckie if it isn't a Local Script Player.Character won't work unless you use GetPlayerFromCharacter()
You don't need the parenthesis after NumPlayers since NumPlayers is a property.
@User, it'd work, you didn't read my script correctly probably.
I wouldn't really recommend using 'ipair'; When the current Position in a Table hits nil, while using 'ipairs', the loop will stop. :P
"pairs" might do same.
'pairs' doesn't do the same as 'ipairs'; From my testing with both recently, 'ipairs' (I knew for a long time) stops when the Table position hits nil, then stops the loop, however, 'pairs' appears to skip the 'nil' position of the table, and continues the loop to the next position within the Table, until it reaches the end of the Table.
Oh, Okay.