You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I’m trying to make a GUI which will create teams and check if a new team was created to add a button to do stuff with. -
What is the issue?
The team color is identifying as false when there is another team with the same team color and will continue making teams which I do not want. The code:
local ExistingTeam
for _,Team in pairs(game.Teams:GetTeams()) do
print(BrickColor.new(coloursInput))
print(Team.TeamColor == BrickColor.new(coloursInput))
if Team.TeamColor == BrickColor.new(coloursInput) then
ExistingTeam = Team
end
if ExistingTeam then
return
end
local NewTeam = Instance.new("Team")
NewTeam.TeamColor = BrickColor.new(coloursInput)
NewTeam.AutoAssignable = false
NewTeam.Name = teamInput
NewTeam.Parent = game.Teams
break
end
-
What solutions have you tried so far?
I have looked at countless devforum threads; however I can’t find one related to the issue I have at all(I’m hoping its not me being stupid)