Modme Forums

Trigger shooter weapon

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


ModmeBot:

Thread By: alexisloic21

I would like to know if its possible that a trigger is only shootable with the wunderwaffe?


ModmeBot:

Reply By: natesmithzombies

alexisloic21

I would like to know if its possible that a trigger is only shootable with the wunderwaffe?

Place a trigger>damage and use the following code on it in script to check the weapon causing the damage:

self waittill( "damage", amount, attacker, direction_vec, point, type, tagName, modelName, partName, weapon, dFlags, inflictor, chargeLevel );
		if( weapon == GetWeapon("tesla_gun") ) // change tesla_gun to whatever weapon you want


ModmeBot:

Reply By: alexisloic21

thanx ;D

good


ModmeBot:

Reply By: alexisloic21

I put this in the while(1)?


ModmeBot:

Reply By: natesmithzombies

alexisloic21I put this in the while(1)?

yes


ModmeBot:

Reply By: alexisloic21

I always have a problem when I put the line of code and I shoot with the wunderwaffe the template and the trigger can not be deleted

function shootable1()
{	
	trig1 = GetEnt("shootable_trig", "targetname");
    obj1 = GetEnt("shootable_model", "targetname");
    trig1 SetHintString("");
    trig1 SetCursorHint("HINT_NOICON");

    while(1)
    {
    	self waittill( "damage", amount, attacker, direction_vec, point, type, tagName, modelName, partName, weapon, dFlags, inflictor, chargeLevel );
		if( weapon == GetWeapon("tesla_gun"))
		{
		trig1 waittill("trigger",player);
		level.headtoshootable++;

        break;
		}
		
    }
	trig1 Delete();
    obj1 Delete();
}


ModmeBot:

Reply By: natesmithzombies

alexisloic21

I always have a problem when I put the line of code and I shoot with the wunderwaffe the template and the trigger can not be deleted

function shootable1()
{	
	trig1 = GetEnt("shootable_trig", "targetname");
    obj1 = GetEnt("shootable_model", "targetname");
    trig1 SetHintString("");
    trig1 SetCursorHint("HINT_NOICON");

    while(1)
    {
    	self waittill( "damage", amount, attacker, direction_vec, point, type, tagName, modelName, partName, weapon, dFlags, inflictor, chargeLevel );
		if( weapon == GetWeapon("tesla_gun"))
		{
		trig1 waittill("trigger",player);
		level.headtoshootable++;

        break;
		}
		
    }
	trig1 Delete();
    obj1 Delete();
}

You were close but your syntax is a bit off. Try the following:

function shootable1()
{	
	trig1 = GetEnt("shootable_trig", "targetname");
    obj1 = GetEnt("shootable_model", "targetname");
    trig1 SetHintString("");
    trig1 SetCursorHint("HINT_NOICON");

    while(1)
    {
    	trig1 waittill( "damage", amount, attacker, direction_vec, point, type, tagName, modelName, partName, weapon, dFlags, inflictor, chargeLevel );
		if( weapon == GetWeapon("tesla_gun"))
		{
		level.headtoshootable++;

        break;
		}
		
    }
	trig1 Delete();
    obj1 Delete();
}


ModmeBot:

Reply By: alexisloic21

thanks ;D


ModmeBot:

Reply By: natesmithzombies

alexisloic21

thanks ;D

You're welcome :)