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

Conditions don't happen if there's more than 1 player?

--"Getting Ready To Play..." should come up if there is more than 1 player, correct? What am I doing wrong? local timertext = game.StarterGui.ScreenGui.StatusTitle.Text

while true do wait()

if game.Player.NumPlayers <= 1 then 
	timertext = "Waiting For More Players..."
	else 
	timertext = "Getting Ready To Play..."
end

end

1 answer

Instead of changing startergui's gui, which no one sees, change the gui in the PLAYER!


Final Product

function check()
	if game:GetService("Players").NumPlayers >= 1 then
		for _,p in pairs(game:GetService("Players"):GetPlayers()) do
			local timertext = p:FindFirstChild("StatusTitle", true)
			if timertext then
				timertext.Text = "Getting Ready To Play..."
			end
		end
	end
end

check() --Do it like this because while loops will change text forever since it is an infinite loop.



I cannot give you the full script! Sorry, anyway! Hope it helps!

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