0

# How to fix "Attempt to call a string value" error?

Pejoume 11
2 years ago

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



0
Pejoume 11
2 years ago

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