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

How do I make a specific action trigger a for loop?

Asked by 3 years ago
for _, child in pairs(workspace.Ruins.RedCastleRuin:GetChildren()) do
            if child:IsA("Part") then
                for i = BricksToWin, 1, 1000 do
                    child.Changed:Connect(function()
                        print("Destroyed")
                    end)
                end
            end
        end

I want the inner for loop to only count whenever the child.Changed event runs

0
I would say to change the for loop to a while loop, that way you can choose when you want to increment the value instead of incrementing every single time pickles980 4 — 3y
0
ok thx ChisomAnimations 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

For the context here, you don't need a loop, use intvalue

Ad

Answer this question