Happy Near Years Eve everyone. Anyway, so this value (with the script in it) is placed into your character from a different script (That works). The script that is not working is supposed to change the value of the StringValue to something specific, which depends on which team you are on. However, the script doesn't work. I have no idea why, and Output gave me nothing. Can someone please help me? Here's the script:
local check = game.Players:getPlayerFromCharacter(script.Parent.Parent) repeat wait() until check:findFirstChild("TeamColor") while true do if check.TeamColor == ("Bright violet") then wait(0.1) script.Parent.Value = "AL" elseif check.TeamColor == ("Bright yellow") then wait(0.1) script.Parent.Value = "Brazil" elseif check.TeamColor == ("Bright blue") then wait(0.1) script.Parent.Value = "China" elseif check.TeamColor == ("White") then wait(0.1) script.Parent.Value = "EU" elseif check.TeamColor == ("Bright orange") then wait(0.1) script.Parent.Value = "India" elseif check.TeamColor == ("Brown") then wait(0.1) script.Parent.Value = "NorthKorea" elseif check.TeamColor == ("Bright red") then wait(0.1) script.Parent.Value = "Russia" elseif check.TeamColor == ("Bright green") then wait(0.1) script.Parent.Value = "US" end end
This is an easily fixable but common mistake.
You're trying to compare a Color3
value with a String
value.
You cannot do:
if check.TeamColor == ("Bright violet") then
Instead, it has to be:
if check.TeamColor == BrickColor.new("Bright violet") then