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

What's up with my script?

for test1 = 10, 0, -1 do
	test2 = Instance.new("Hint", Workspace)
	test2.Text = "Intermission (" ..test1.. ")"
	wait(1)
	game.Workspace.Message:remove()
end

if #game.Players:GetChildren() > 2 then
	h = Instance.new("Hint", Workspace)
	h.Text = "Hello, and welcome to MrSmenryBackups' Tournament!"
end

if #game.Players:GetChildren() > 0 then
	h = Instance.new("Hint", Workspace)
	h.Text = "There must be 2 or more players to start!"
end

I don't get any errors, but when 2 people are there, it still says "There must be 2 or more players to start!"

1 comment

0

Do as ultimate said, except for line 8 make it >= 2 so that if the amount of players is greater than or is 2 the game will start.

1 answer

✓ Accepted answer

Line 13 you put:

if #game.Players:GetChildren() > 0 then

That means whenever a player is in a game it will always display "There must be 2 or more players"

To solve this you must use "Else"

Try this:

for test1 = 10, 0, -1 do
    test2 = Instance.new("Hint", Workspace)
    test2.Text = "Intermission (" ..test1.. ")"
    wait(1)
    game.Workspace.Message:remove()
end

if #game.Players:GetChildren() > 2 then
    h = Instance.new("Hint", Workspace)
    h.Text = "Hello, and welcome to MrSmenryBackups' Tournament!"
else
    h = Instance.new("Hint", Workspace)
    h.Text = "There must be 2 or more players to start!"
end

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