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

Instance.new not creating Teams?

Asked by 4 years ago

For some reason when I try and create a team it doesnt create it. I cant tell if its not parenting or just not creating it at all. Can anyone help?

01local plrs = game.Players:GetChildren()
02local redTeam = {}
03local blueTeam = {}
04 
05local plrsOnEachTeam = math.floor(#plrs / 2)
06 
07function Team()
08for i = 1, plrsOnEachTeam, 1 do
09    local Team = game:GetService("Teams")
10    local RedTeam = Instance.new("Team")
11    RedTeam.Parent = Team
12    RedTeam.TeamColor = BrickColor.new("Really red")
13    RedTeam.Name = "Red"
14    local Folder = Instance.new("Folder", RedTeam)
15    Folder.Name = "leaderstats"
View all 38 lines...
0
The BlueTeam parent is off on line 24 and are you running the function? Warfaresh0t 414 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

listen i am no expert but when u parented the "RedTeam" i think you shoudve said Teams not "Team" maybe like this

01local plrs = game.Players:GetChildren()
02local redTeam = {}
03local blueTeam = {}
04 
05local plrsOnEachTeam = math.floor(#plrs / 2)
06 
07function Team()
08for i = 1, plrsOnEachTeam, 1 do
09    local Team = game:GetService("Teams")
10    local RedTeam = Instance.new("Team")
11    RedTeam.Parent = game.Teams
12    RedTeam.TeamColor = BrickColor.new("Really red")
13    RedTeam.Name = "Red"
14    local Folder = Instance.new("Folder", RedTeam)
15    Folder.Name = "leaderstats"
View all 38 lines...
Ad

Answer this question