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

[SOLVED I FIXED IT MYSELF!] how to detect if multiple parts have moved?

Asked by 3 years ago
Edited 3 years ago

I have tried making a for loop in my game for that. I'll just include the part of the script with the part.

Can someone tell my why this won't work and how to fix it

InRound.Changed:Connect(function()

        for _, child in pairs(workspace.Ruins:GetChildren()) do
            if child:IsA("Part") then
                for i = BricksToWin, 1000, 1 do
                    if child.Position == Vector3.new(0,-2,0) then
                        print("Destroyed")
                        Score.Value = "A team has:".. i .. "bricks destroyed"
                    end
                end
            end
        end
    else

1 answer

Log in to vote
0
Answered by 3 years ago

Instead of using the if child.Position, use the child.Changed event

Ad

Answer this question