How would I detect for there being another team with the same teamcolor?
Hello! I need to figure out how to make a "Create Team" system, I currently have a gui and everything, however i need to check if there are other teams of the same teamcolor. I tried using a for loop which didn't work, but i may have messed it up or something. Along with that, im running this by using a localscript to fire a remote event which leads to this.
01 | function createcrew(player,color) |
03 | if player.leaderstats.Doubloons.Value > = 5 then |
06 | player.leaderstats.Doubloons.Value = player.leaderstats.Doubloons.Value - 5 |
07 | local team = Instance.new( "Team" ) |
08 | team.AutoAssignable = false |
09 | team.TeamColor = color |
10 | team.Parent = game.Teams |
11 | team.Name = player.Name.. "'s Crew" |
13 | player.Neutral = false |
14 | local owner = Instance.new( "StringValue" ) |
16 | owner.Value = player.Name |
25 | game.ReplicatedStorage.CreateCrew.OnServerEvent:Connect(createcrew) |