Printing something once a value is equals to something

Not really sure how to phrase it, but I need an if statement to continuously check if the value of something is 0.

This is what I came up with but if statements only check the value once, I would want something more on the lines of a .Touched event.

	if #PlayersWhoHaveNotAnswered == 0 then
		print("all players have answered")
	end

Help would be appreciated!

1 Like

while true do loop might work if u want it to do it over and over

2 Likes

I did end up going for this:

while AllPlayersHaveAnswered == false do
		if #PlayersWhoHaveNotAnswered == 0 then
			AllPlayersHaveAnswered = true
		end
		wait(1)
	end

But I doubt that this is the most efficient way of doing it, if anyone knows a better way I’ll really like to hear it :smiley:

1 Like

I think this is better

while #PlayersWhoHaveNotAnswered > 0 and wait() do end
AllPlayersHaveAnswered = true
1 Like