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

Can someone help me with Rounds?

Asked by 10 years ago

So I have a game that I want to implement rounds in. I can do basically everything else, I just need to know how to have the game either wait a certain amount of time (Say 120 seconds) to continue the script, or have a value be true.

Example:

There is a button that needs to be pressed, and the player must beat the obby in 120 seconds or less and hit the button. If the player hits the button, it continues with the script, if they fail to complete it in the 120 seconds, it will still continue with the script.

1 answer

Log in to vote
1
Answered by 10 years ago

For loops. Conditions. Break.

All simple things.

Example: Make a BoolValue inside the player to determine if the button was clicked. You could easily do this, and change it true when they click it.

Then:

local breakable = false

for i = 1,120 do
    wait(1)
    if breakable == true then
        break
    end
    for _,v in next, game.Players:GetPlayers() do
        if v.BoolValue.Value then
            breakable = true
        end
    end
end

0
What do you mean by "Break the for loop" would I just use :Break() or something? Tempestatem 884 — 10y
0
Updated. systematicaddict 295 — 10y
Ad

Answer this question