Question about my new Roleplay game

How would I make it so if a person is jailed (in the jailed team), they can’t switch teams.

I do not understand. Give more info. I don’t know how he switching team

I want it to check what team they’re on, if they’re on the jailed team it gives them an error.

Can u give me some screenshots or scripts? I just don’t have info to help you

Whatever mechanism in your game that switches their team would have to account for this. And for us to help you on that, you’ll need to provide code.

On the flip side, if the game uses SpawnLocation.AllowTeamChangeOnTouch, then I’m afraid I have bad news. There’s no way to check beforehand; you’ll have to write your own script for this.

This is simplest what can i do:

local Player = game.Players.LocalPlayer

if Player.Team == game.Teams["teamName"] then
--your code
end

I’m not a coder to be honest, I’m just the UI designer and my scripter doesn’t have the dev forum so I’m asking for him.

Give atleast some screenshots of your game so i can understand

Alright, let me contact the Scripter and I’ll respond.

Okay, amma try to check smth about team change

@PhantomGame_Youtube function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Pearl”)
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:connect(Click)

use

--put your code here

– function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Pearl”)
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:connect(Click)

image
click that and then put script

function Click(mouse) 
	script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Pearl") 
	script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end  
script.Parent.MouseButton1Click:connect(Click) 

Ty lemme check it also i did small video for you, uploading it.

Okay so. Can you say what script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = … means? What is it button or idk

As i see this is player. Bruh this script need a rework give me a second…

It gets the team color, I have it in starter GUI

Also video about team checking:Team Change - YouTube