Game Modding | Call of Duty: Black Ops 3 | Scripting
Pepergogo:
Hi So yeah, I was wondering if is possible to spawn a model using a "trigger_use"?
I have a sound and it activates when you press the trigger, and I want to also spawn a model at the same time. Here's my script:
functionradio_play_sound(trigger_string,sound_string){trig=getEnt(trigger_string,"targetname");//trig setHintString("Press &&1 to enable radio");trigwaittill("trigger",player);playerplaysound(sound_string);level.radio_playing=true;wait(SoundGetPlaybackTime(sound_string)*0.001);level.radio_playing=false;}
Spiki:
Hi So yeah, I was wondering if is possible to spawn a model using a "trigger_use"?
I have a sound and it activates when you press the trigger, and I want to also spawn a model at the same time. Here's my script:
functionradio_play_sound(trigger_string,sound_string){trig=getEnt(trigger_string,"targetname");//trig setHintString("Press &&1 to enable radio");trigwaittill("trigger",player);playerplaysound(sound_string);level.radio_playing=true;wait(SoundGetPlaybackTime(sound_string)*0.001);level.radio_playing=false;}
#precache( "model", "<model alias>");
//at the top. also add to zone unless you have this model in the map already
after trig. put down a script_struct where you want the model to spawn. you can give it the kvp "model" to see how it would look ingame
struct=struct::get("model_spot","targetname");model=Spawn("script_model",struct.origin);//spawn at structmodelSetModel("<model alias>");model.angles=struct.angles;
Pepergogo:
#precache( "model", "<model alias>");
//at the top. also add to zone unless you have this model in the map already
after trig. put down a script_struct where you want the model to spawn. you can give it the kvp "model" to see how it would look ingame
struct=struct::get("model_spot","targetname");model=Spawn("script_model",struct.origin);//spawn at structmodelSetModel("<model alias>");model.angles=struct.angles;