Modme Forums

Replace texture or remove brush on damage

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


Kenny:

This question has been answered here: https://www.t7mods.com/viewtopic.php?t=60
______________________________________________________________________________________________________________

Hey hey,

What I'm trying to do is to have a brush and when someone shoots it the brush gets replaced with a another texture or it just disappears and reveals a different texture behind it.
I'm not so good at gsc scripting and i tried to put together a script with the help of other scripts but nothing seems to work for me.

What would be the correct way to do this?

Here is what i have yet.
This is supposed to remove the brush when it receives damage but like i said i'm not good at gsc scripting so please dont judge me if this makes no sense:

function removeBrush_init(){
        trig1 = GetEnt("brush1", "targetname");
        trig2 = GetEnt("brush2", "targetname");
        trig1 thread removeBrush();
        trig2 thread removeBrush();
}
function removeBrush(){
        self waittill( "damage" );
        self delete();
}

I'm not even enitrely sure if the trigger has to be a trigger_damage or something else so if anyone can please help me with this i would really appreciate it!
Thank you!


Magicman:

Hey hey,

What I'm trying to do is to have a brush and when someone shoots it the brush gets replaced with a another texture or it just disappears and reveals a different texture behind it.
I'm not so good at gsc scripting and i tried to put together a script with the help of other scripts but nothing seems to work for me.

What would be the correct way to do this?

Here is what i have yet.
This is supposed to remove the brush when it receives damage but like i said i'm not good at gsc scripting so please dont judge me if this makes no sense:

function removeBrush_init(){
        trig1 = GetEnt("brush1", "targetname");
        trig2 = GetEnt("brush2", "targetname");
        trig1 thread removeBrush();
        trig2 thread removeBrush();
}
function removeBrush(){
        self waittill( "damage" );
        self delete();
}

I'm not even enitrely sure if the trigger has to be a trigger_damage or something else so if anyone can please help me with this i would really appreciate it!
Thank you!


a trigger_damage needs to be used