Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

--"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

Log in to vote
0
Answered by 9 years ago

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!

Ad

Answer this question