I want to make a script where you are in a certain team and you get a certain gui for that team. For example in my case, I want to make a script where if a player gets jailed it puts a message for them indicating they have broken the rules. I’ve tried to understand and research how to do this but I yet can’t. If anybody could help I would be more than happy. Here’s the script I’ve come up till now:

local Player = game.Players.LocalPlayer

if Player.Team.TeamColor == BrickColor.new(“Really Black”) then
script.Parent.JailedGui.Visible = true
end