Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Player not showing under team properly?

When a player joins, I've got a script that changes their TeamColor to the same colour as the 'Flight' team, and sets 'Neutral' to false. Very basic.

game.Players.PlayerAdded:connect(function(Player)
	Player.TeamColor = BrickColor.new("Institutional white")
	Player.Neutral = false
end)

However, it hasn't worked. This keeps happening. The name has only shown up correctly (under the Team) at random times when I test it, and after the one of the Player's Leaderstats values have been changed. Any help is appreciated, and thanks in advance. Also apologies if this is not exactly script-related, I was just unsure.

2 answers

✓ Accepted answer

It's a bug, I've been having problems with it too.

2 comments

0

Thanks.

0

It also happens when you insert a script using Kohl's admin and add a new team but you can fix it by using the :fix command.

game.Players.PlayerAdded:connect(function(Player)
	wait(0.25) --It waits for it to load.
   	Player.TeamColor = BrickColor.new("Institutional white")
   	Player.Neutral = false
end)

3 comments

0

That wouldn't help even if it fixed the problem, because then the player's character would spawn in the middle of the game. Also, I'm pretty sure the player loads instantaneously.

0

Well if you already know then why don't you do it.

0

Well use a while loop look: while wait() do if Player.Character then break end end --This will keep looping and not let the other code run until the character has been loaded.

This discussion is preserved as it was. New answers, comments, and votes are closed.