My script isnt working. It is supposed to just simply print “works” if these conditions are correct. I used print() to check the players conditions to see if they match and they do, but the if command isnt working. how can i fix this?
local folder = script.Parent.Parent
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player.TeamColor == BrickColor.new("Really Red") and folder.blueflagtook.Value == false then
print("works")
end
end
end)