Hey there!
I am currently developing a game and having a bit of trouble, so i have a script that checks when a models “health” reaches 0 and when it does all mesh parts should be deleted but for some reason only 1 mesh gets deleted not all of them?
The Script:
-- This script is located within a proximity prompt that is in a part which is inside of the model, this is also a server script
health:GetPropertyChangedSignal("Value"):Connect(function()
local clone = chunk:Clone()
clone.Parent = repStore
clone.Mine.ProximityPrompt.MaxActivationDistance = 10
local child = chunk:GetChildren() -- Not looping through all children?
for i, v in pairs(child) do -- Not looping through all children?
if v:IsA("MeshPart") then
v:Destroy() -- Only deletes 1?
wait(10)
clone.Parent = game.Workspace
chunk:Destroy()
end
end
end)
Thanks for the help!