UGX-Mods 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 Facebook
Sign In with Twitch

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

broken avatar :(
Created 5 years ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
1,914 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
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: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
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 LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
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 months ago
Posts
40
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: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
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 LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
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"?

Code Snippet
Plaintext
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 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
Code Snippet
Plaintext
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 (:
 
 
 
 

 
Loading ...