I'm trying to make a webhook that tells people how many players are in the game and I keep getting an error. Here is the part of the script that keeps giving me errors, it triggers when a player joins the hostile team.
local nPlayers = game.Players:GetPlayers() local Strin = " " for i,v in ipairs(nPlayers) do Strin = Strin.. v.Name " " .. "\n" end
I was able to use this function instead and it worked like a charm.
local function PlayersOnTeamString(Team) local TeamString = "" for _, v in pairs(Team:GetPlayers()) do if v then TeamString = TeamString .. v.Name .. "\n" end end return TeamString end