Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

1 comment

0

Try using indentation, and he said from 1 counting up to 30 not the opposite.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.