Hello! Welcome to my first devforum tutorial!
Today I wanted to learn people how to make a Team Select GUI + Team Spawns!
Step 1
Activate the Team Service.
Go into the “Model” Tab and go over to “Advanced” and choose the bottom left icon, with the blue and red things.
Click the button and this screen will open.
Click “Teams” and insert it! We will need this further into the tutorial!
Step 2
Now, you will have to add a ScreenGui, with a frame.
Step 3
Add in as many TextButtons as the teams you want. All those buttons will need a LocalScript inside of it.
Your GUI now should look like this.
Step 4
This is really important! Add in an “ObjectValue” in the TextButtons. We’re not going to do anything with this yet. Call these Values “Team”.
Step 5
Add teams into the “Teams” folder.
The first Team you’ll add will be called “Choosing Team”. This will be for the users who just joined and still need to choose what team they want to be on. Keep all settings, don’t change anything. Now it’s time to add your own teams!
I will add two simple teams called “Noobs” and “Pros”.
Step 6
Change the text of your TextButtons to the teams you have. Now we’re going to do something with the values we have inserted in Step 4. You want to name both of these values to the name of the team, which should be in your textbutton. Next, you will have to CLICK the field so this appears. Make sure this appears.
Now, you need to know what teams ObjectValue you’ve chosen by looking at the TextButton. For example, I chose the value of my “Pros” team. Now you want to make sure you still have the value clicked, and you want to open the “Teams” folder and then click the team which you chose the value of. For example, I chose Pros, now I need to click on the Pros team in my team folder.
You should now have this. Do the same for the other teams.
Step 7
Time to script!
local team = script.Parent.Team
local frame = script.Parent.Parent
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
frame.Visible = false
player.Team = team.Value
end)
No need to change anything, just put this in all localscripts in your GUI.
Last step, 8
Now, we’re going to make the team spawns. Insert two SpawnPoints into your game.
Open these settings. Now, you want to give the Teams in the Teams folder two different colours, and change TeamColor in these settings to one of the Teams its colors. Now, that team will spawn at that SpawnLocation. Do this with both spawn points.
Now, the player will spawn at the right spawn after selecting their team! If you have any questions, don’t hesitate to ask!
Thanks for reading my tutorial!