Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

well this value isent working at all help?????????

Asked by
hokyboy 169
2 years ago
Edited 2 years ago

while true do if game.ReplicatedStorage.Players == 1 then -- this nummer value is in dah repilicated storage wait(1) game.StarterGui.ScreenGui.Frame.TextLabel.Text = "You need 2 players to start a round" end game.StarterGui.ScreenGui.Frame.TextLabel.Text = "Round Starting Soon" end

1 answer

Log in to vote
0
Answered by
awfulszn 357 Moderation Voter
2 years ago
Edited 2 years ago

Firstly you shouldn't store a value of the amount of players in ReplicatedStorage, it's pointless.

Let's create the variables.

local label = game.StarterGui.ScreenGui.Frame.TextLabel

Now let's check if there is only one or less people in the lobby. If not, we'll update the label.

while game.Players.NumPlayers < 2 do
    label.Text = "You need 2 players to start a round"
    repeat wait() until game.Players.NumPlayers >= 2 -- Wait until the minimum amount of players have joined.
end

Full Code:

local label = game.StarterGui.ScreenGui.Frame.TextLabel

while game.Players.NumPlayers < 2 do
    label.Text = "You need 2 players to start a round"
    repeat wait() until game.Players.NumPlayers >= 2
end
0
already used the playernumb i was just bening verry dumb WHAT THE HECK WHY DE HECK I SHOULD USE A NUMBER VALUE LOL hokyboy 169 — 2y
0
If this helped you, make sure to click the accept answer button. awfulszn 357 — 2y
Ad

Answer this question