Making a CSoundPatch work when spawned in a different PVS

Recently I’ve been working on an entity that requires a looping sound. The thing about this looping sound, however, is that not everybody is going to be around when it is first created (using CreateSound.) For some reason, probably involving PVS’s, I can’t seem to get the sound to be audible if you weren’t near it when it was created. I’ve tried starting and stopping it, using Source’s soundscript names instead of the raw filenames (though, I haven’t tried making my own soundscripts) and yet it still doesn’t work.

The sound works fine if you happen to be near the source when it is initially created, and even as the source moves around the map, but not if you weren’t near it when it spawned.

Any ideas for workarounds, or some CSoundPatch functions that aren’t listed in the wiki or something?


I tried some work with the SetupPlayerVisibility hook, still no results. However, I think I found a really hacky solution, for anyone who’s interested, though a better fix would really be preferable:
[lua]local function HaxCreateSound(ent, name, soundorigin)
for _, p in pairs (player.GetAll()) do
p.TeleMeBack = p:GetPos()
local sound = CreateSound(ent, name)
for _, p in pairs (player.GetAll()) do
p.TeleMeBack = nil
return sound
This seems to be working fine, I’m testing in a listen server hosted by myself though, so it might not work so well with others, haven’t tested it. Are there any better solutions out there?