So when they touch a part in workspace I want the script to check if the player is in a certain team, if so then take their cframe and put it on the other side of the door. Thing is I don't think I am finding the players team Color properly. Yes, this is a server script.
script.Parent.Touched:connect(function(hit) print("Yes") local player = game.Players:GetPlayerFromCharacter(hit.Parent) print("Just random words") if player then print("Getting better") if player.Team.TeamColor == "Bright Red" then print("Found color") print("Apart of this dorm") hit.Parent.Torso.CFrame = script.Parent.CFrame + Vector3.new(0,0,5) end end end)
You cannot compare a BrickColor to a string directly.
Instead, you must either compare the BrickColor's Name
component to a string or
compare two BrickColors together.
if myColor.Name == "Bright red" then -- Do something... end
if myColor == BrickColor.new("Bright red") then -- Do something... end