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

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

Asked by
hokyboy 270 Moderation Voter
6 years ago
Edited 6 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 394 Moderation Voter
6 years ago
Edited 6 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 270 — 6y
0
If this helped you, make sure to click the accept answer button. awfulszn 394 — 6y
Ad

Answer this question