Very basic and simple question, if I loop through every instance inside the Players service, will every instance be a Player, or will I have to check if the instance is a Player?
For example, I have some code that checks what team every player is on, and then teleports them to the lobby. I haven’t code much, not much at all, but I want to make sure I’m doing this right.
Current Code:
for i, plr: Player? in pairs(Players:GetChildren()) do
if plr:IsA("Player") then --// Should I do this??
--// Code here
end
end
If each instance inside of Players was a Player, the code would look like this:
for i, plr: Player in pairs(Players:GetChildren()) do
--// Code here
end
Thanks.