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

Why doesn't it destroy the package/CharacterMesh?

Asked by
notfenv 171
4 years ago
local debounce = false
function onTouched(hit)
    local Player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
           if debounce then return end
           debounce = true
           script.Parent.Sound:Play()
           for i, v in pairs(Player.Character:GetChildren()) do
           if v:IsA("CharacterMesh") then
           v:Destroy()
          wait(2)
          debounce = false
        end
    end
end

script.Parent.Touched:Connect(onTouched)

Help?

0
maybe do GetDescendants instead of GetChildren NSMascot 113 — 4y
0
^. CharacterMeshes are not direct children of the player's Character. DeceptiveCaster 3761 — 4y

Answer this question