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

How to make bricks fall in order?

Asked by 9 years ago

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

Log in to vote
3
Answered by 9 years ago
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.

0
Additionally you're gonna want to alphabetically order your bricks so they fall in the order you want SquirreIOnToast 309 — 9y
0
Lol. This already got solved. But I'll accept anyways. NeonicPlasma 181 — 9y
Ad

Answer this question