Wondering how to script a specific weapon to enable a damage trigger?

broken avatar :(
Created 102 days ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
267 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 days ago
Posts
27
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
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!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 11 days ago
Posts
338
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksDistenc5Teffrie
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.
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 days ago
Posts
27
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
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"?
 
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 11 days ago
Posts
338
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
I love skulls
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksDistenc5Teffrie
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
Last Edit: July 06, 2019, 11:06:12 am by gympie6
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 days ago
Posts
27
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
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 (:
 
 
 
 

 

Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Twitch
Loading ...