I've tried printing player[i] in a while loop and it just retrieves one player who survived. But using this method i've got below the table just throws an error and nothing is displayed.

Any idea what is wrong with it?

for i=1,#players do
		local survived = getTag(players[i], "BoolValue", "survived", false)
		if survived then
			table.insert(survivedt, players[i])
			wait(0.2)
			_G.survivedp = (table.concat(survivedt,' '))
		end
		wait(0.4)
	end

2 comments

0

What is getTag?

0

I've also got this in there for handing out coins to players, setTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Coins", getTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Coins", 0) + math.random(5,10))