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

How do you make a message countdown from 1, to 30?

Asked by 10 years ago

I've been wondering this, for a while so here it goes, is "," the piece of code for doing "To"? Like 1,30 would be like saying count from 1 to 30? What's the coma supposed to do exact? If that's correct, how do you use it for messages, so that it will repeat it from 30, until it gets to 0?

2 answers

Log in to vote
1
Answered by
Damo999 182
10 years ago

Easy use a for loop

for i = 30,1,-1 do
    m = Instance.new("Message",Workspace)
    m.Text = i 
    wait(1)
    m:Remove()
end


-- the coma just separates the numbers it's something you don't really think about you just memorize it as you go.
0
Try using indentation, and he said from 1 counting up to 30 not the opposite. Vividex 162 — 10y
Ad
Log in to vote
-1
Answered by
Vividex 162
10 years ago
m = Instance.new("Message", Workspace) --Labels the type of Message, for a Hint replace "Message" with "Hint"

for i = 1,30 do --This is a for loop, it repeats something a certain amount of times, the , is used for example like the word "to" or a  "-" saying that it will start from 1 and end at 30, 1 to 30 (1-30)
    m.Text = i --Makes the message text the 1-30
    m:Destroy() --After it reaches 30 it destroys itself
end --Ends the loop

Answer this question