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

How to make bricks fall in order?

So what I am making is a game called Crumble Runner. My problem is that the bricks won't fall in order, so I need someone to help me. Here is my piece of code:

wait(3)
for i = 100, 1, -1 do -- This is how many bricks there are (100)
	local pads = script.Parent.Pads:GetChildren()
	local num = math.random(1, #pads)
	local unanchor = pads[num]
	unanchor.Anchored = false
	wait(0.8)
end

1 answer

✓ Accepted answer
for i,v in pairs(script.Parent.Pads:GetChildren()) do
	v.Anchored = false --Might be v or i, forgive me if it's wrong. I haven't scripted in a while.
	wait(0.8)
end

That works the table identification into one line, along with the start of the loop and takes up half the lines you tried to.

I'm SquirrelOnToast, and you're welcome.

2 comments

0

Additionally you're gonna want to alphabetically order your bricks so they fall in the order you want

0

Lol. This already got solved. But I'll accept anyways.

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