How To Make GUI Of Team Changer?

Hello! I am CafeHomme12! I Want Make A GUI Of Team Changer!
I Will Make GUIs But I Don’t Know How To Make Team Changer. Could You Help Me?

Hi CafeHomme12!

  1. What do you want to achieve? Keep it simple and clear!
  2. What is the issue? Include screenshots / videos if possible!
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub ?

Hello nicemike40!
I want make a GUI For Team Changer I Will Make GUIs But I Don’t know I how to make
Script.

I Only Can Do Team Creating
So I Need Help

And I Can Model For Teams. So Only I Need Help For Script.

You could do something along the lines of the following:

Client:

local teamButton = script.Parent
local teamChangeEvent = game:GetService("ReplicatedStorage"):WaitForChild("TeamChange")
local player = game:GetService("Players").LocalPlayer

teamButton.Activated:Connect(function()
	local teamChanged = teamChangeEvent:InvokeServer(teamButton.Name)
	if teamChanged then
		script.Parent.Parent.Enabled = false
	end
end)

Server:

local teamChangeEvent = game:GetService("ReplicatedStorage"):WaitForChild("TeamChange")

function changeTeam(player, newTeam)
	local changedTeam = false
	if player and newTeam then 
		local team = game:GetService("Teams")[newTeam]
		if team then
			player.Team = team
			changedTeam = true
		end
	end
	return changedTeam
end

teamChangeEvent.OnServerInvoke = changeTeam

Hello, firstly I’d like to say that this category is not to ask people to write scripts for you. Second, there are so many tutorials of team changer in Youtube. let me know if u have questions.