Hey again everyone.
I was fiddling with some sounds I wanted to play whenever a player gets a notification from my custom notification HUD system thingy.
But as far as I know, other players can also hear this sound being emitted.
Is there any way of making it local? Player only?
This is the code line: (clientside)
[LUA]EmitSound( Sound( notificationSoundPath ), lply:GetPos(), 1, CHAN_AUTO, 1, 100, 0, 100 )[/LUA]
Any help is appreciated :D
-Fillipuster
If you don't mind it not being in 3d space then
[url]http://wiki.garrysmod.com/page/surface/PlaySound[/url]
Otherwise,
[url]http://wiki.garrysmod.com/page/sound/Play[/url]
[url]http://wiki.garrysmod.com/page/sound/PlayFile[/url]
There are of course a bunch of other ways to play sounds but these seem to be the best for what you want.
Try this:
[code]lply:SendLua([[surface.PlaySound("sound")]])[/code]
That's if you're sending it from server side,
Client Side:
[code]surface.PlaySound("sound")[/code]
Okay, I will mess with all this, thanks guys :D
Sorry, you need to Log In to post a reply to this thread.