Hello. I am having trouble creating a GUI Text Button that can switch a player team. I know where to put the script, but I don't know what to put in it. Can someone help me?
COMMUNITY QUESTION
How do I create a team switching GUI Text Button?
1 answer
First, make a button in the corner (or wherever you want) which will open a GUI with an list of teams, add a frame with a button for every team and add this LocalScript and make it invisible by disabling the Visible property inside of it.
The LocalScript inside the button which will show the Team change frame should look like this:
local Frame = Script.Parent.Parent.Frame
local Button = script.Parent
Button.MouseButton1Click:Connect()
Frame.Visible = true
end
The buttons' LocalScripts which will change the team should look like this:
local Player = game.Players.LocalPlayer
local Team = --Your Team Here
local Button = script.Parent
Button.MouseButton1Click:Connect()
Player.Team = Team
end
If you want to add a cancel button in the frame, its LocalScript will be very simmilar to the show button script, but it will make the frame invisible, like this:
local Frame = Script.Parent.Parent.Frame
local Button = script.Parent
Button.MouseButton1Click:Connect()
Frame.Visible = true
end
If you want more information about GUIs, can go to the Intro to GUIs tutorial.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
huh? post script please.
Please post your attempt at scripting this before asking a question here, as this forum is for helping solve problems or errors that people have run into after attempting to create something first. We cannot help you fix something if there is nothing to fix.
If you are talking about designing the GUI, it's all based of your creativity & skill. Look into it more. Team Changing GUI can be as basic as the one from jailbreak, or they can have lots of information in them.