How do I compare team to Bright red?
function tele() wait() c=game.Players:GetChildren() for i=1, #c do team = c[i].TeamColor if team == "Bright red" then <-----Problem here print("RED") end end end while true do wait(5) tele() end
To expound on what M39 said, TeamColor is a type of value called a BrickColor value. What that line of script is doing therefore is comparing some letters ("Bright Red") to a Color value, which clearly colors and letters aren't the same thing so it spits out an error. That's why you have to say:
if team == BrickColor.new("Bright Red") then --in this case you're asking it to make sure that the colors are the same end
I ran into this problem and fixed it like so:
function tele() wait() c=game.Players:GetChildren() for i=1, #c do team = c[i].TeamColor if team.Name == "Bright red" then --.Name adds the string value tag so it will match string "Bright red" print("RED") end end end while true do wait(5) tele() end