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

Whats wrong with my blinking text GUI script that runs on < 3 players?

while true do 
	if game.Players.NumPlayers< 3 then 
		script.Parent.Visible = true 
		wait(.5) 
		script.Parent.Visible = false 
	elseif game.Players.NumPlayers>= 3 then 
		script.Parent.Visible = false 
	end 
end

Please fix this! Thanks! It does not work for me!

1 answer

Your code is in a while loop, so here's the order things will happen if the number of players is less than 3:

script.Parent.Visible = true
wait(.5)
 script.Parent.Visible = false
--immediately it goes back to the start of the loop, setting script.Parent.Visible = true

You need to add a wait(0.5) after script.Parent.Visible = false, because otherwise the loop restarts and it immediately sets script.Parent.Visible = true

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