I'm new to Roblox, so excuse me if this question is stupid, but I didn't find anything in wiki.
I've created 2 teams "Mafias" and "Policemen". For now, I assign all players to mafias team. But in-game, every player gets Policemen team, I don't know why.
local mafiaTeam = nil local policeTeam = nil function onPlayerAdded(player) player.Neutral = false player.TeamColor = mafiaTeam.TeamColor -- set to mafia end function setUp() mafiaTeam = Instance.new("Team", Game:GetService("Teams")) mafiaTeam.Name = "Mafias" mafiaTeam.TeamColor = BrickColor.Red() policeTeam = Instance.new("Team", Game:GetService("Teams")) policeTeam.Name = "Policemen" policeTeam.TeamColor = BrickColor.Blue() end setUp() Game.Players.PlayerAdded:connect(onPlayerAdded)
What's the problem? If you can figure it out, help me please.
Thanks in advance
UPDATE: as it seems to be, the problem is with GUI. Physically, I'm in mafias team (I've checked player's properties with server console + my name color is red, as it should be if I'm in mafias team), but GUI shows that I'm in policemen team. Any suggestions?
Most likely the issue is, that the 'Play solo' mode loads player earlier than script get's to load. That is common and very frustrating problem, so instead do 'Start server' and within server 'Start player'.