Like I know Team:GetPlayers() gets the list of players in a Team but if I wanted to make a Raid system for a group I need to be able to set the amount of players required per team. It doesn't seem that "if Team.Players.NumPlayers == Insert Value Here" works here. So, how would I go about doing this?
local teamA = game:GetService("Teams"):WaitForChild("Valkan") local teamB = game:GetService("Teams"):WaitForChild("Raiders") -- Raiders game.Players.PlayerAdded:Connect(function(a) if teamB:GetPlayers() >= teamA:GetPlayers() then script.raid.Value = true local m = Instance.new("Message",workspace) m.Text = "RAID ON" wait(6) m:Destroy() end end)
You can simple add #
before team:GetPlayers()
Example:
local Team = game:GetService("Teams"):WaitForChild("Blue") print("I got " .. #Team:GetPlayers() .. " players in Blue team.")
"This simple take the length of something..."
Hope it helped :D