Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I create a team switching GUI Text Button? [closed]

Asked by 5 years ago

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?

0
huh? post script please. B_rnz 171 — 5y
0
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. lunatic5 409 — 5y
0
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. Black_Sea 11 — 5y

Closed as Not Constructive by lunatic5, namespace25, Lugical, ee0w, and TheeDeathCaster

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Vik954 48
5 years ago

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.

Ad