Modme Forums

Special Easter Egg door script

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


Dedrix:

I'm basically looking for a way to cause a trigger with a specific weapon. Mainly trigger a door to open with a shield. A custom script to put whichever weapon and/ door would be very appreciated. Thanks


Spiki:

This should work. didnt test

//call this
function weapon_trigger()
{
trigs = GetEntArray("weapon_trigger","targetname");
foreach(potato in trigs)
    potato thread setup_weapon_trigger();
}


function setup_weapon_trigger() //self = trig damage
{
while(1)
    {
    self waittill( "damage", amount, attacker, direction_vec, point, type, tagName, modelName, partName, weapon, dFlags, inflictor, chargeLevel );
    if(is_right_gun(weapon))
        break;
    }


door = GetEnt("door?","targetname");
door Delete();

}


function is_right_gun(weapon)
{
trigger_guns = array("pistol_standard", "zod_riotshield");

foreach(gun in trigger_guns)
    if(IsSubStr(ToLower(weapon.name), ToLower(gun))) //incase attachments and pap
        return 1;
return 0;
}


Dedrix:

********************************************************************************
UNRECOVERABLE ERROR:
 ^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_hornburg.gsc'
ERR(0) scripts/zm/zm_hornburg.gsc (313,14) in "is_right_gun()" : syntax error, unexpected TOKEN_RETURN :         return


Linker will now terminate.
********************************************************************************


Spiki:

********************************************************************************
UNRECOVERABLE ERROR:
^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_hornburg.gsc'
ERR(0) scripts/zm/zm_hornburg.gsc (313,14) in "is_right_gun()" : syntax error, unexpected TOKEN_RETURN :         return


Linker will now terminate.
********************************************************************************

fixed
also it told you where the problem was. you could have fixed it yourself


Dedrix:

fixed
also it told you where the problem was. you could have fixed it yourself

Yes, although I have a pea brain sooo...