I tried with citizen team and that worked and then I switched to the police team but then it still says I am not a police.
Here is the localscript:
local player = game.Players.LocalPlayer local gui = player:FindFirstChild("PlayerGui"):FindFirstChild("CarUI") local button = gui:FindFirstChild("ButtonsFram"):FindFirstChild("CopCar") local CivCarFrame = gui:FindFirstChild("CivCarsFrame") local CopCarFrame = gui:FindFirstChild("CopCarsFrame") open = true button.MouseButton1Click:connect(function() if player.TeamColor == "Cyan" then CivCarFrame.Visible = false CopCarFrame.Visible = true else button.Text = "You are not police!" wait(2) button.Text = "Police Cars" end end)
Your problem is on line 9. See Player API, which shows that TeamColor is BrickColor, which is never equal to a string. Instead, do player.TeamColor.Name == "Cyan"
or player.Team.Name == "Police"
(the second option lets you change the TeamColor and the script will still work).