Modme Forums
Menu:

how to trigger explosion

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


ModmeBot:

Thread By: Ahmed02354
I want to put a grenade on the ground and when people shoot it I want it to explode and disapear.
How can i do this?


ModmeBot:

Reply By: Dan9977

function shootable()
{
    trig = GetEnt("shootable_trig", "targetname");
    model = GetEnt("shootable_model", "targetname");
 
    trig SetHintString("");
    trig SetCursorHint("HINT_NOICON");
 
    while(1)
    {
        trig_1 waittill("trigger", player)
 
        break;
    }
 
    trig Delete();
    model Delete();
  
}
In radiant, make a script_model (the object you want to disappear) and a trigger_damage around the object. Give the object a target name of "shootable_model" and the trigger a target name of "shootable_trig".


ModmeBot:

Reply By: Dan9977
I made a mistake in the script. trig_1 should be trig.
Also, make sure to put level thread shootable(); in the main function of your mapname.gsc and the shootable script at the bottom of mapname.gsc.


ModmeBot:

Reply By: Ahmed02354

Dan9977
I made a mistake in the script. trig_1 should be trig. Also, make sure to put level thread shootable(); in the main function of your mapname.gsc and the shootable script at the bottom of mapname.gsc.



thanks will try this tomorrow