Modme Forums

Make explosive weapon splash damage kill owner in one shot?

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


Sleepy216:

So I was trying to bring back the annoying at4 from the old zct mod, however I cannot for the life of me get an explosive weapon to kill the owner in one shot.

No matter what, the player only loses 75 health(even when the player had 500 initial health). I assumed the damage to owner scalar had something to do with it. After changing the value from 0 to 2, and many numbers in between, nothing changed. I also set the damage absurdly high(10k inner, 9k outer) with 5x damage multipliers to all body parts.

Is there a way for explosives to one tap the owner within the weapon file? Or do I need to script it?

Thanks for your time and the help.


eDeK:

Maybe something like this, idk.

callback::on_spawned( &xxx );
function xxx()
{   
    for( ;; )
    {
        self waittill( "damage", amount, attacker, dir, point, mod );

        gun = attacker GetCurrentWeapon();

        my_specific_gun = "ray_gun";

        if( isdefined( attacker ) && isdefined( attacker.playername ) && attacker.playername == self.playername )
        {
            if( gun.name == my_specific_gun )
            {               
                self DoDamage( self.health + 666, self.origin );                             
            }                                               
        }       
    }
}


Harry Bo21:

Maybe something like this, idk.
callback::on_spawned( &xxx );
function xxx()
{   
    for( ;; )
    {
        self waittill( "damage", amount, attacker, dir, point, mod );

        gun = attacker GetCurrentWeapon();

        my_specific_gun = "ray_gun";

        if( isdefined( attacker ) && isdefined( attacker.playername ) && attacker.playername == self.playername )
        {
            if( gun.name == my_specific_gun )
            {               
                self DoDamage( self.health + 666, self.origin );                             
            }                                               
        }       
    }
}

function xxx()
{
    self endon( death_or_disconnect );


Sleepy216:

Maybe something like this, idk.
callback::on_spawned( &xxx );
function xxx()
{ 
    for( ;; )
    {
        self waittill( "damage", amount, attacker, dir, point, mod );

        gun = attacker GetCurrentWeapon();

        my_specific_gun = "ray_gun";

        if( isdefined( attacker ) && isdefined( attacker.playername ) && attacker.playername == self.playername )
        {
            if( gun.name == my_specific_gun )
            {             
                self DoDamage( self.health + 666, self.origin );                           
            }                                             
        }     
    }
}

Oh I din't expect you to write the script or anything! I was just curious if it could be done in the weaponfile settings. You rock, thank you regardless!
I'll throw the script in and check it out!

function xxx()
{
    self endon( death_or_disconnect );


I'm guessing you want this since the function gets run every time the player spawns? I'm just guessing that's what callback:: on_spawn does, or is it that it only runs once after the players spawn?

So you want to kill the old function first? Or does the death notify/flag only get triggered when everyone dies?

edit. added a space in the callback line. dumb emoji


Harry Bo21:

It’s to kill the thread if you die or at the end or it’ll run more than once for every time you die