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

Finding the amount of players with this value?

Asked by 10 years ago
                for _,v in pairs (game.Players:GetChildren()) do
                    delay(#playerss, function()
                        if v.Status.Value == "Vigilante" then
                            if #v == 0 then
                                workspace.Countdown.Value = 0
                                roundended = true
                            end
                        end
                    end)
                end

I'm getting a problem with userdata values, is there any other way I can do this? I'm trying to find the amount of Vigilantes which are left, and if there is none, then the round ends and the countdown becomes 0.

1 answer

Log in to vote
0
Answered by
TomsGames 225 Moderation Voter
10 years ago

Hi Zakkeh :)

I'm not sure where you're keeping the vigilantes but I strongly suggest that you have them stored in the workspace as variables. For example, in workspace have a variable called "Stats" and under that have "Vigilantes", "Killers", "Heros", "Detectives" etc...

When the game starts the players that are assigned those roles add one to each role. Then for certain events (death, leaving game) it takes one off. This may make your stat counting a lot easier.

0
Thanks mate, that's something thinking about it I really should have thought of! :-) AstralKick 25 — 10y
Ad

Answer this question