• Welcome Guest, The new Modme forums are here! Please visit here for all recommended information.

Help Play sound when touch a trigger

Pepergogo

Undead member
Hi, so I've a custom script and I'm trying to play a sound when you touch the trigger_multiple, the thing is, it just make the other functions except for play a sound
PHP:
function boss_fight1()
{
    trig = GetEnt("bf_trig1","targetname");
    door = GetEnt("bf_door1", "targetname");

    trig waittill("trigger", player);

    //Boss fight
    level flag::set( "spawn_zombies" ); //Start zombie spawn
    player playsound("music_BW"); //Start music
    wait(60); //Fight time
    door Delete(); //Delete door
    trig Delete(); //Delete trigger
}
Anyone know what can I do to fix it? :(
 

Pepergogo

Undead member
Is the sound set up properly in the script and in audacity?
Yeah, I copy another alias that work fine and replace it with the new song
My song is .wav and 48000 hz
But I don't know why doesn't play
And is something with the script because doesn't play any song I put in them
 

Pepergogo

Undead member
I'm using the script from a function, so is:
function main(){
thread boss_fight
...
}

And then at the bottom the script I post.

I also try putting at the end of the main function but still nothing.
And yeah, I'm usign music.csv, is where I have all the songs and they work fine, is just the script who doesn't play it :(
 

Dorp

Member
I'm thinking it has something to do with your mapname.szc file located at usermaps/zm_mapname/sound/zoneconfig. Is the alias set up correctly within this file?
 

Pepergogo

Undead member
I'm thinking it has something to do with your mapname.szc file located at usermaps/zm_mapname/sound/zoneconfig. Is the alias set up correctly within this file?
Yeah, I have correctly cuz the other sounds that are in there play just fine, like the perks, characters and all of that
Is just the script that doesn't play it :(
 

Dorp

Member
Try using a different sound from your alias in the script to see if it works. That'll tell you if it's the script or the sound that has the issue.
 

Pepergogo

Undead member
Try using a different sound from your alias in the script to see if it works. That'll tell you if it's the script or the sound that has the issue.
Yeah already try that
I add a new song and nothing, I change to another song that I know that work and still nothing
I know is the script but I don't know why if the alias and everything else is set up correctly :(
 
I have had a similar issue and guess what 40 compiles later it worked
so here's my advice
delete your snd sabl files located in
\steamapps\common\Call of Duty Black Ops III\usermaps\zm_zomsinspace\sound\zone\
I deleted the folder called cache banks

keep compiling till they are regenerated and if the sound still doesn't play the script is wrong
 

Pepergogo

Undead member
I have had a similar issue and guess what 40 compiles later it worked
so here's my advice
delete your snd sabl files located in
\steamapps\common\Call of Duty Black Ops III\usermaps\zm_zomsinspace\sound\zone\
I deleted the folder called cache banks

keep compiling till they are regenerated and if the sound still doesn't play the script is wrong
Perfect, I'm gonna try later
Thanks 😎
 
void <player> PlayLocalSound(<sound name>)
    • [MANDATORY] <sound name> The name of the sound or hash
  1. CATEGORY: Player
    CLIENT/SERVER: Server
    SUMMARY: Plays a sound locally
    EXAMPLE: self playlocalsound( "evt_squad_activate" )
This may help as well

this is in the bops 3 mod docs located in
Steam\steamapps\common\Call of Duty Black Ops III\docs_modtools

lots of engine functions there like this.
just press ctrl F then put what you're looking for in the search bar
in this case it'd be sound
 
Top