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)

10 comments
Does
#team.getPlayers()not give you what you want?No, like let me put my script in here so you can see what I mean.
edit message and put this code in codebox.
Replace
teamB.Players.NumPlayerswith#teamB:GetPlayers()We're getting closer. But now I got a different error. :)
is the length operator, gets the length of string or table, just to explain yHasteeD's answer a bit
Ah. Thank you all for your help. Now it's working. :)
Hey, I actually do have one more question for you all. So just for future reference, has "Players.NumPlayers" been deprecated?
Research https://developer.roblox.com/api-reference/property/Players/NumPlayers
Ah. That was my thought. Lol, well I am glad they deprecated it.