So I want to make a system where you can rob things, but of course only criminals should be able to. But for some reason my team checking script doesn't work.
This is the code I made:
script.Parent.ClickDetector.MouseClick:Connect(function(player) if player.Team == game.Teams.Criminal then print("yes") end end)
Please Help!
Try this:
script.Parent.ClickDetector.MouseClick:Connect(function(player) if player.TeamColor == game.Teams.Criminal.TeamColor then print("yes") end end)