Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Players survived list not working?

Asked by
Cuvette 246 Moderation Voter
8 years ago

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
0
What is getTag? Validark 1580 — 8y
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)) Cuvette 246 — 8y

Answer this question