How to make the detector delete the part that was detected

script.Parent.Touched:Connect(function(h)
    local ball =  game.Workspace.Plinko.Balls.PlinkoBall
    if ball:IsA("Part") then
        print('0.5x Triggered')
        wait(0.2)
        ball:Destroy()
    end
end)

Issue:
For some reason when I click more than once it destroys the second spawned ball first.

Because your not deleting the part that hit the detector but rather that ball, which only has one reference

I’m a builder so scripting is a newer thing for me, how would I define what get’s detected.
(The script above is the script I have inside the detector)

the Touched function returns the part that it touched, so h in your script would be the part to remove

script.Parent.Touched:Connect(function(h)
    if h:IsA("Part") and h.Name == "PlinkoBall" then
        print('0.5x Triggered')
        wait(0.2)
        h:Destroy()
    end
end)

might not be correct since it’s been a while since i’ve coded

1 Like

Thank you very much, even while being rusty you saved me.