Dummies are supposed to be destroyed after you activate the prompt, but only the next spawned dummy gets destroyed.
I know that a little confusing but basically I have a system where dummies fall down and are supposed to be destroyed on activation of the prompt, but only the next dummy in line gets destroyed. Anyone know how to fix.
heres the code:
script.Parent.Triggered:Connect(function(plr)
local torso = game.ServerStorage.Torso:Clone() -- testing purposes **ignore**
local con -- when each dummy is touching this part, if the prompt is activated, the dummies should get destroyed
con = game.Workspace.Claw.ClawHelper.Touched:Connect(function(hit)
if hit.Name == "torsoWeld" then -- each Dummy has a part called torsoWeld.
local remover = hit.Parent
torso.Position = game.Workspace.Claw.ClawHelper.Position -- testing purposes **ignore**
remover:Destroy()
if con then con:Disconnect() end
script.Parent.Enabled = false
wait(5) -- cooldown
script.Parent.Enabled = true
end
end)
end)
heres a video just in case my explaining is confusing.
any tips are appreciated.