CSoundPatch not stopping.

I’ve just worked out a new sound system, one which uses CreateSound and calls :Stop() after the SoundDuration(sound) so that you have more control over :EmitSound()
So, I just solved the issue regarding the sound looping (with the above), but it seems that the sound will NOT stop when the SNPC has died which is starting to piss me off…

Here’s the actual code for the system ~
[lua]
function ENT:UtilizeSound(Table,Bool)
if self:IsOtherSoundPlaying() then
self:EndSound() //Calling EndSound within InitSound prevents the sound from playing at all, unsure why.
end
self:InitSound(Table,Bool)
end

function ENT:InitSound(Table,Bool)
if !Table or !Bool or !(type(Table) == “table”) then return NULL end
local fSoundDir = table.Random(bTable)
local fSoundDur = SoundDuration(fSoundDir)
local fSound = CreateSound(self,fSoundDir)
self.CurSound = fSound
fSound:Play()
fSound:SetSoundLevel(70)
timer.Create(“StopLP”,fSoundDur,1,function()
fSound:Stop()
if Bool == true then
self:ONREMOVESOUNDADD(fSound)
end
return fSound
end)
end

function ENT:EndSound()
if self.CurSound != NULL then
self.CurSound:FadeOut(0)
end
end

function ENT:IsOtherSoundPlaying()
if self.CurSound != NULL then
if self.CurSound:IsPlaying() then
return true
end
end
end

function ENT:ONREMOVESOUNDADD(SOUND)
if (SOUND) then
table.insert(self.s_dSounds,1,SOUND)
end
end
[/lua]

Not sure if it means much, but (clearly) this death sound occurs at JUST the moment the SNPC is removed.