Modme Forums

Shootable to give weapons?

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


ModmeBot:

Thread By: Lokii
How would i go around making one of these I just want so a guy can shoot something in the sky and it will give them a gun


ModmeBot:

Reply By: modric
Pretty easy to make yourself but I would recommend using abnormal's easy easter egg system so you can adjust variables and its all set up for you. http://aviacreations.com/modme/index.php?view=topic&tid=1130&page=1#post5455


ModmeBot:

Reply By: mathfag
Add a trigger_damage to the area you want shot and name the targetname "d_trig".
Or if you want to shoot a model directly copy some code from here.


Paste this in your script

function autoexec damage_trig()
{
trig = GetEnt("d_trig","targetname");
trig waittill( "damage", amount, attacker );
//IPrintLnBold(attacker);
attacker zm_weapons::weapon_give(getweapon("ray_gun"));
trig Delete();
}

No need for thread damage_trig();


ModmeBot:

Reply By: Harry Bo21

function model_gives_gun()
{
	e_model = getEnt( "shootable_gun_reward", "script_noteworthy" );
	e_model setCanDamage( 1 );
    
	while ( 1 )
	{
		e_model waittill( "damage", damage, attacker, dir, point, mod, model, tag, part, weapon, flags, inflictor, chargeLevel );
        
		if ( attacker laststand::player_is_in_laststand() || IS_TRUE( attacker.intermission ) )
			continue;
		
		if ( !zm_utility::is_player_valid( attacker ) )
			continue;
        
		break;
	}
	
	attacker zm_weapons::weapon_give( getWeapon( "weapon_name" ) );
	e_model delete();
}

paste at the bottom of your mapname gsc

then under


zm_usermap::main();


add this :

level thread model_gives_gun()


in radiant place a script_model of your choice and give it the kvp

shootable_gun_reward - script_noteworthy