Modme Forums

Spawn Music

Game Modding | Call of Duty: Black Ops 3 | Scripting


Koguchi:

Hey everyone! I want to set up a sound file to play right as the players spawn in, like in MOTD for example. I looked online and can't find what I'm looking for so I'm posting it here, hoping someone can either help me or point me in the right direction. I've already got custom round sounds if that matters. Thanks in advance!


Spiki:

callback::on_spawned(&on_player_spawn);


function on_player_spawn() //self = player
{
self PlayLocalSound(<sound name>);

}


Koguchi:

callback::on_spawned(&on_player_spawn);


function on_player_spawn() //self = player
{
self PlayLocalSound(<sound name>);

}


thanks for this man! I'm assuming it goes in my gsc, idk where else it would go lol. Do I have to put in a specific place in my file or can I just drop it anywhere in there and have it work?


Spiki:

thanks for this man! I'm assuming it goes in my gsc, idk where else it would go lol. Do I have to put in a specific place in my file or can I just drop it anywhere in there and have it work?

callback::on_spawned(&on_player_spawn);

in main