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

How do you do this after a certain number of loops?

Say I had a "for" loop that repeated 10 times, but after 3 loops I'd want something else to occur without changing what happens in the loop. How would I do this?

1 answer

✓ Accepted answer

You assign an index value to your loop. When the index value hits three, you execute the code:

for i = 1,10 do
	-- regular
	if i == 3 then
		-- special code
	end
end

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