Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Player not showing under team properly?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

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

0
Thanks. infalliblelemon 145 — 10y
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. Kozero 120 — 10y
Ad
Log in to vote
-2
Answered by 10 years ago
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)

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. infalliblelemon 145 — 10y
0
Well if you already know then why don't you do it. SilenceCore 25 — 10y
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. SilenceCore 25 — 10y

Answer this question