How would I wait until a local player is assigned a team?

Hey! I was looking everywhere but I could not find a solution, how would I wait until the player is assigned a team? my original answer was to do this:


but it kept going and going, is there a way to do this?

I ask because of this error here:


The player is 100% assigned a team at the start, but the script just goes too fast

Thanks for reading!!!

1 Like

if this is a local script, probably add a wait for 1 sec at the top

i think you might find it here: How would I fetch/obtain a player's team via workspace/local player?

2 Likes

try:

if player.Team == nil then
player:GetPropertyChangedSignal("Team"):Wait()
end

If team is nil (like the error says above) it will wait until a change occurs before proceeding the script.

Also I assumed player == Players.LocalPlayer .

2 Likes

Hey mb I was late, but thanks a lot!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.