Switch Team GUI, doesn't really switch teams (only the teamcolor, and not the team only tools)

I was making a switch team script, but for some reason, it doesn’t really team you. It does team you, but doesn’t spawn you on the spawn team and team only tools.

I believe I do need a remote event, since I inserted the script in the local script.

local groupid = 12648144
local rank = 2
local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()

	if plr:IsInGroup(groupid) then
		plr.TeamColor = BrickColor.new("Navy blue")
		plr.Team = game.Teams["FBI Operatives"]
		plr.Character:BreakJoints()
		end
end)


1 Like

Yes, you’d need a remote event to change the players team on the server side

1 Like

Or you could use a server script and avoid remotes

in server script:

local groupid = 12648144
local rank = 2

game.Players.PlayerAdded:Connect(function(player)
	if player:IsInGroup(groupid) then
		player.TeamColor = BrickColor.new("Navy blue")
		player.Team = game.Teams["FBI Operatives"]
		player.Character:BreakJoints()
	end
end)

Because when you wrote in a local script, you become the “FBI Operative” team only on your screen, to others you are not in that team, when you press play in roblox studio, theres a button that says “Current: Client” or something like that, when you press it it will switch to the server POV, and you can see how others see you

You’re right. But in my opinion, I’ll add remote event. Thank you for your opinion

Uh, do I need multiple remote event per script or no?

You just need the single one, you can use the same script for each text button

That would be the case if he wanted it to be auto-teamed, but you’d need a remote event if you’re using a GUI to change teams

Ahh i didn’t see that my bad (charsssssssssssssss)

Alright, thank you for the help. I was curious if I should use remote event since it’s on a local script lol.

Oh and, I instead added individual remote events per script, so that it doesn’t get confused.

You could set the property of one of the teams to AutoAssignable (make it the default team) and the other team to not AutoAssignable, then have the script assign players to the team which is for group members only (the non-AutoAssignable team). Doing away with the gui entirely.