Game Modding | Call of Duty: Black Ops 3 | General Discussion
ModmeBot:
Thread By: Christians_Gaming
So want to have some of my ambient sounds to play, when I have the power on. Is that possible? It's because I have a flickering light ambient, and it doesn't make sense, if it's on when the power is of, then people will be confused! Help?
Sry for bad english ;(
ModmeBot:
Reply By: mathfag
Place script_structs with targetname-"cher_sound"
script_string-"sound alias"
If you want it to play a sound after power add script_noteworthy-"power"
And paste this to the bottom of your script. No threading necessary.
function autoexec sound()
{
level waittill("initial_blackscreen_passed");
structs = struct::get_array("cher_sound", "targetname");
foreach(str in structs)
{
if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power")
{
spot = Spawn("script_model",str.origin);
spot PlayLoopSound(str.script_string,15);
}
}
level waittill("power_on");
foreach(str in structs)
{
if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power")
{
spot = Spawn("script_model",str.origin);
spot PlayLoopSound(str.script_string,15);
}
}
}
ModmeBot:
Reply By: Harry Bo21
mathfag
Place script_structs with targetname-"cher_sound" script_string-"sound alias" If you want it to play a sound after power add script_noteworthy-"power" And paste this to the bottom of your script. No threading necessary. function autoexec sound() { level waittill("initial_blackscreen_passed"); structs = struct::get_array("cher_sound", "targetname"); foreach(str in structs) { if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } level waittill("power_on"); foreach(str in structs) { if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } }
e_model = util::spawn_model( "model_name", v_origin, v_angles );
"Name: spawn_model(, [origin], [angles], [spawnflags])"
"Summary: Spawns a model at an origin and angles."
"Module: Utility"
"MandatoryArg: the model name."
"OptionalArg: [origin] the origin to spawn the model at."
"OptionalArg: [angles] the angles to spawn the model at."
"OptionalArg: [spawnflags] the spawnflags for the model."
"OptionalArg: [b_throttle] respect the global spawn throttle."
"Example: fx_model = spawn_model("tag_origin", org, ang);"
ModmeBot:
Reply By: Christians_Gaming
mathfag
Place script_structs with targetname-"cher_sound" script_string-"sound alias" If you want it to play a sound after power add script_noteworthy-"power" And paste this to the bottom of your script. No threading necessary. function autoexec sound() { level waittill("initial_blackscreen_passed"); structs = struct::get_array("cher_sound", "targetname"); foreach(str in structs) { if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } level waittill("power_on"); foreach(str in structs) { if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } }
ModmeBot:
Reply By: mathfag
Christians_Gaming
mathfag Place script_structs with targetname-"cher_sound" script_string-"sound alias" If you want it to play a sound after power add script_noteworthy-"power" And paste this to the bottom of your script. No threading necessary. function autoexec sound() { level waittill("initial_blackscreen_passed"); structs = struct::get_array("cher_sound", "targetname"); foreach(str in structs) { if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } level waittill("power_on"); foreach(str in structs) { if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } } Is it in gsc or? Sry I'm a beginner xD
ModmeBot:
Reply By: Christians_Gaming
mathfag
Christians_Gaming mathfag Place script_structs with targetname-"cher_sound" script_string-"sound alias" If you want it to play a sound after power add script_noteworthy-"power" And paste this to the bottom of your script. No threading necessary. function autoexec sound() { level waittill("initial_blackscreen_passed"); structs = struct::get_array("cher_sound", "targetname"); foreach(str in structs) { if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } level waittill("power_on"); foreach(str in structs) { if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } } Is it in gsc or? Sry I'm a beginner xD gsc. Everything is gsc unless it says otherwise
ModmeBot:
Reply By: mathfag
Christians_Gaming
mathfag Christians_Gaming mathfag Place script_structs with targetname-"cher_sound" script_string-"sound alias" If you want it to play a sound after power add script_noteworthy-"power" And paste this to the bottom of your script. No threading necessary. function autoexec sound() { level waittill("initial_blackscreen_passed"); structs = struct::get_array("cher_sound", "targetname"); foreach(str in structs) { if(!isdefined(str.script_noteworthy) && str.script_noteworthy != "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } level waittill("power_on"); foreach(str in structs) { if(isdefined(str.script_noteworthy) && str.script_noteworthy == "power") { spot = Spawn("script_model",str.origin); spot PlayLoopSound(str.script_string,15); } } } Is it in gsc or? Sry I'm a beginner xD gsc. Everything is gsc unless it says otherwise It doesn't work m8 :(