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!

2 comments
It works, but only when I'm set to criminal as default. Don't know why.
Sorry, my bad. It's just a client / server communication error. Thank You!