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

How could i make this cooldown wait code more simple? [ANSWERED]

Asked by 5 years ago
Edited 5 years ago

Code:

                wait(1)
                NumValue.Text = "10"
                wait(1)
                NumValue.Text = "9"
                wait(1)
                NumValue.Text = "8"
                wait(1)
                NumValue.Text = "7"
                wait(1)
                NumValue.Text = "6"
                wait(1)
                NumValue.Text = "5"
                wait(1)
                NumValue.Text = "4"
                wait(1)
                NumValue.Text = "3"
                wait(1)
                NumValue.Text = "2"
                wait(1)
                NumValue.Text = "1"
                wait(1)
                NumValue.Text = ""

I've seen it done properly, i just cant remember where.

If you need to know what it is for, it's a short cooldown message that appears on a door.

0
U Simply Cant SummerEquinox 643 — 5y

2 answers

Log in to vote
0
Answered by
LuaDLL 253 Moderation Voter
5 years ago
for i = 10,0,-1 do
wait(1)
NumValue = i
end
0
numvalue.Text Imperialy 149 — 5y
0
Explain. Explain. Explain. Don't just post code. SummerEquinox 643 — 5y
0
Hey, he solved it for me, i didn't need any extra help! Cut the dude some slack. mrfrank79 30 — 5y
0
When making answers on scriptinghelpers you are expected to explain your code and not just provide it. SummerEquinox 643 — 5y
View all comments (3 more)
0
explain the code. yHasteeD 1819 — 5y
0
It's a self explanatory for loop. If you can't understand this then you probably should learn the basics. xXrawr_xdXxOwO 24 — 5y
0
come back here 2 years later, this is Summer you literally said it wasn't possible so i don't know what makes you so special lol mrfrank79 30 — 3y
Ad
Log in to vote
-2
Answered by
Imperialy 149
5 years ago
counting = true
while counting do
    if NumValue.Text > 0 then
        wait(1)
        NumValue.Text = NumValue.Text - 1
    end
end

just do while wait() do and subtract the text

0
sorry Imperialy, yours doesn't work properly. mrfrank79 30 — 5y
0
NumValue.Text:len() Gey4Jesus69 2705 — 5y
0
wot Imperialy 149 — 5y
0
10:len() doesnt even 10 Imperialy 149 — 5y

Answer this question