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

How do I make a Team-Checking and Team-Moving script?

Asked by 9 years ago

I've asked this question multiple times on the forums, and wasn't able to get the correct answer, and so here I am, asking the nice community, if you guys could help me with this; How would a script go, if it's tasked with checking if anyone's in "Neutral" Team, and if that's true, it would create a team and put them into the one that has been created?

2 answers

Log in to vote
2
Answered by 9 years ago

You of course are going to have to make some edits of the script I am about to list below, but I will include steps on what you may have to edit!

Step 1: Create a new script, name it whatever and place it in Workspace Step 2: Throw this code into the script, be sure to read below about the edits you have to do.

The code:

01local teams = game:GetService("Teams")
02local neutral = teams:FindFirstChild("Neutral")
03local redteam = Instance.new("Team", teams)
04redteam.Name = "Red Team"
05redteam.TeamColor = BrickColor.new("Really red")
06local okayvalue = false
07 
08if teams and redteam and neutral then
09    okayvalue = true
10end
11 
12game.Players.PlayerAdded:connect(function(player)
13    if okayvalue == false then
14        repeat
15            wait()
View all 25 lines...

Step 3: If you are going to change the team color and team name, then replace everything for team color that says "Really red" with the new color name. If you are going to change the team name, change redteam.Name = "newnamehere"

Step 4: This should work, enjoy your new script c:

0
Works only in studio. Aperturee 22 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago

Works only in studio.

Answer this question