I have made a team changer using a GUI. It uses image buttons and there are local scripts in each image button.
local Plr = game.Players.LocalPlayer
local USMCID = 4487957 -- this is just so I can group lock the teams
function pressed()
if Plr:IsInGroup(USMCID) then
Plr.Team = game.Teams:FindFirstChild("US Marines")
Plr.Character.Head:Destroy()
script.Parent.Parent.Visible = false
end
end
script.Parent.MouseButton1Click:Connect(pressed)

8 comments
Is there a team spawn?
Yes. I unmarked neutral and changed the team color to match but it still doesnt work
Instead of destroying the head (killing them) you should teleport them instead.
How can I do that?
Also if they die again would they be teleported back?
Try using RemoteEvents to teleport the player or event kill the player. If you don't, it won't be ServerSided and only the player playing will see it so it won't actually happen. If you need more information on how RemoteEvents work feel free to use one of my answers on a related post as a reference.
^ - https://scriptinghelpers.org/questions/94651/can-someone-help-me-understand-remote-events-they-dont-work-for-me#87427
Or you can use a script instead of a local script. Which ever one you feel is the easiest. But, I recommend RemoteEvents as you have to do less complicated methods and work.