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

Finding the amount of players with this value?

				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

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.

1 comment

0

Thanks mate, that's something thinking about it I really should have thought of! :-)

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