UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Chadric273 on July 03, 2019, 11:04:38 pm

Title: Wondering how to script a specific weapon to enable a damage trigger?
Post by: Chadric273 on July 03, 2019, 11:04:38 pm
Hey guys!

Question is as the title says it. I was wondering how to write a line of script that makes it so you have to use only the bowie knife in order to enable a trigger damage? I am wanting the player to have to cut a chord in the map, but I want it so that only the bowie knife can cut the chord. Any help would be much appreciated!
Title: Re: Wondering how to script a specific weapon to enable a damage trigger?
Post by: gympie6 on July 04, 2019, 04:23:27 pm
Hey guys!

Question is as the title says it. I was wondering how to write a line of script that makes it so you have to use only the bowie knife in order to enable a trigger damage? I am wanting the player to have to cut a chord in the map, but I want it so that only the bowie knife can cut the chord. Any help would be much appreciated!
 I don't know how it works in bo3 but I know how to do it in waw.

In code you have to get the trigger, when the trigger fires you have to check which weapon that player is holding. If it is the weaponName bowie knife you can let him do the rest of the code.
Title: Re: Wondering how to script a specific weapon to enable a damage trigger?
Post by: Chadric273 on July 05, 2019, 09:41:33 pm
I don't know how it works in bo3 but I know how to do it in waw.

In code you have to get the trigger, when the trigger fires you have to check which weapon that player is holding. If it is the weaponName bowie knife you can let him do the rest of the code.
 
 Okay, what you are saying makes sense however my knowledge on how to write code isn't the greatest. What would a line of code look like that would "check  which weapon the player is holding"?
 
Title: Re: Wondering how to script a specific weapon to enable a damage trigger?
Post by: gympie6 on July 06, 2019, 10:55:04 am
Okay, what you are saying makes sense however my knowledge on how to write code isn't the greatest. What would a line of code look like that would "check  which weapon the player is holding"?

trig = getEnt("nothing","targetname");

while(1)
{
        trig waittill("trigger", player);
        weapon = player getcurrentweapon();
        if(weapon == "bowie")
        {
            // do stuff
            break;
        }
        wait(1);
}
This is how you can do it in Cod World at War
Title: Re: Wondering how to script a specific weapon to enable a damage trigger?
Post by: Chadric273 on July 07, 2019, 04:24:15 am
trig = getEnt("nothing","targetname");

while(1)
{
        trig waittill("trigger", player);
        weapon = player getcurrentweapon();
        if(weapon == "bowie")
        {
            // do stuff
            break;
        }
        wait(1);
}
This is how you can do it in Cod World at War
 I shall give this a shot and let you know if it worked for bo3 (: