I'm not sure you can remotely play sounds like that, you'd need a sound emitter near you.
Hey everybody. I need help once again.
I need to make it so that I can play a sound file and it will follow me wherever I go.
I/E
Then I want that sound to follow me (Owner) wherever I go.Code:@name Something soundPlay(1, 10, "Sound File") soundPitch(1, Pitch Here) Something with owner()
How can I do this without making the E2 code follow me? I just want it to play wherever I go.
Thanks.
I'm not sure you can remotely play sounds like that, you'd need a sound emitter near you.
Well I got this code from a friend...who got it from a friend, etc. This plays the sound at the person, or whatever.
Code:@name Owner Sounds @persist P AR:array interval(1) Play = 3 if(first()) { AR:setString(1,"ambient/opera.wav") AR:setString(2,"vo/npc/female01/upthere01.wav") AR:setString(3,"npc/zombie_poison/pz_breathe_loop2.wav") AR:setString(4,"npc/zombie/moan_loop3.wav") AR:setString(5,"ambient/creatures/teddy.wav") AR:setString(6,"vo/ravenholm/madlaugh03.wav") AR:setString(7,"vo/Citadel/br_laugh01.wav") AR:setString(8,"vo/eli_lab/al_laugh02.wav") AR:setString(9,"vo/npc/Barney/ba_laugh02.wav") } if(owner():vel():length() > 40) {P = 1} else{P = 0} if (P&$P){ if(Play == 10) {owner():soundPlay(owner():id(),0,AR:string(randint(1,9)))} else{owner():soundPlay(owner():id(),0,AR:string(Play))} } if(!P&$P) {soundPurge()} soundPitch(owner():id(),floor(owner():vel():length()*100/250))
I want the same thing as that, except with one sound, and it does not change pitch as you move.
You could test something like this pseudo:
[highlight=E2]
if(owner():vel():length() > 40)
{
owner():soundplay(<parameters here>)
}
[/highlight]
Hmmm...Didn't work. Any other suggestions?
That was only pseudo-code, but I assume that you can let entities play a sound.
maybe make the sound emmiter follow you around.
Couple things to keep in mind if it doesn't work:Code:@name Something if(first()) {owner():soundPlay(0,0,"Sound File")}
Server might not have a wiremode version that supports E:soundPlay()
When typing your file path make sure to use "/" and NOT "\" (unless they recently fixed this).
I tested the code I posted above on a server. It worked. I went back to that same server and am trying to get a code for this to work. But I can't seem to do it. So the server has the same wiremod svn settings, etc. It does support E:soundPlay().
Bookmarks