Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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 
		

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.