I’m trying to make a weapon which acts as a sound-transmitter, playing a sound to the players that are surrounding wherever you click.
The problem is that only the player using the weapon can hear the sound, other players can’t.
The function I am using for this is:
function SoundGun(csound) local trace = self.Owner:GetEyeTraceNoCursor() local hpos = trace.HitPos local ppos = self.Owner:GetPos() if trace.HitNonWorld == false then if trace.Hit == true then sound.Play(csound, hpos) end end end
The parameter “csound” is the path to the sound, and “hpos” is the entity that is hit.
It would be amazing if someone could help me fix this problem!