0

Why team shown in GUI is not my team?

Hello.

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.

My code:

local mafiaTeam = nil
local policeTeam = nil

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()


What's the problem? If you can figure it out, help me please.

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?

0
I think this is most likely just a time issue -- I believe your script is working and it's simply acting too soon and the ROBLOX game is overriding your change. Try adding a wait(1) to the beginning of the player event. (I can't run this code to test). Remember that you can use Tools -> Start Server and Tools -> Start Player to test things like this from Studio and get output! BlueTaslem 18044 — 7y
0
Thanks, but that didn't help. However, I've checked the player's TeamColor and it's set to 'Bright red', but in the GUI I see that he's in Policemen team. PathDevel 0 — 7y
0
Here is the screenshot of GUI http://yadi.sk/d/73Pknat1MZwPx PathDevel 0 — 7y

0