-- server script inside the NPC model 

local humanoid = script.Parent:WaitForChild("Humanoid")

local function onDied()
	for _, part in ipairs(script.Parent:GetChildren()) do
		if part:IsA("BasePart") then
			part.Transparency = 1
			part.Anchored = true
		end
	end
end

humanoid.Died:Connect(onDied)
