In the decompiled code we see lots of calls to Effect.server.run(..........); which seem to be triggering sounds client-side. I tried using that code in a plugin and it doesn't seem to have any effect. Anyone ever managed to play a sound for a specific player with a plugin? Is that possible?
Solved Play a sound client-side?
Discussion in 'Rust Development' started by Deicide666ra, Jul 25, 2015.
-
Code:
Effect.server.Run("fx/headshot", player.transform.position, Vector3.zero, null, false);
Code:player.SendEffect("fx/headshot");
-
Did you test this pain? Does the first line work? I tried that last night and couldn't get any sound out of it.. no errors either it just doesn't do anything. Wasn't that exact line though I'll try it...
-
-
Thanks it does work, nice Anyone know how to get a list of all available effects?
-
Thanks mate!
-
-
Well you're double helping me with this one, I knew you had a mod that used GUI to notify of hits, didn't realize you also added sounds.. Was gonna make a mod to play a sound to confirm hits... Guess you beat me to it so that's great, I'll try it out
-
I wont use the line.
Code:Effect.server.Run("fx/headshot", player.transform.position, Vector3.zero, null, false);
Use player.SendEffect(string effect);
or something like Effect.player.Run -
As i said i tested the first one and it worked only for the player. -
-
Code:
Effect.server.Run("fx/headshot", player.transform.position, Vector3.zero, player.net.connection);
-
-
Lets say that I wanted to have a server start song or something when a player joins or when an event has been opened.
If this is possible, how would I link a song that I put into the servers folder to be played? -
-
its a bit late to join that conversation ... but what if .... the player has the sound which one i want to play on him, in his client? does the sound has to build in the prefabs? or is it enough to have the sound in the client folder? .... i mean... i already made overlays etc for clients to see which was not in the client. sooo... somethings possible of that ? eather a hosted sound with URL Or a client - folder sound ?
-
Actually, LaserHydra is right. I did test it on my server, and the server was running an effect at x position, and other players were able to hear it.
-
well i know. i tried that aswell , playing a sound/effect out of the prefabs.. ( dont mess around with that on a server with much players... they will freak the fck out ) . but my question... can i Call the Sound/effect on a client if the file is NOT embed in the prefabs. With a file thats located in the Game Folder.
-