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

Help with loops

I'm trying to make a script that prints numbers 1-10. While 'a' is less than or equal to 5, it should print "less than or equal to 5." While 'a' is greater than or equal to 6, it should print "greater than or equal to 6."

How can I fix this script, or make something scripted differently that does the same thing?

a=0
repeat
	a=a+1
	print(a)
	wait(1)
while a<=5 do
	print("less than or equal to 5")
	wait(1)
while a>=6 do
	print ("greater than or equal to 6")
	wait(1)
end
end
until a==10

1 comment

0

This script was only made for me to learn. It's not intended to be in a game.

1 answer

✓ Accepted answer

Well, that is a way to do it I suppose.

Aswell, you could use a for loop, such as:

for i = 1,10 do
	if i <= 5 then
		print("less than or equal to 5")
	elseif i>= 6 then
		print('Bigger than 5")
	end
end

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