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

GUn trigger

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
4,000 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
How do i make a trigger activate only if it has been shot with a specific gun

for example the ray gun?
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
make a trigger_shoot and then link it to a script that checks what the player is holding. if its the gun, continue with the script, if its not, do nothing. This should work in theory
Last Edit: May 21, 2014, 11:25:36 pm by n123q45
Marked as best answer by pashan 12 years ago
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Code Snippet
Plaintext
Script()
{
Trig = GetEntArray( "ENT", "targetname" );
for( i = 0; i < Trig.size; i++ )
Trig[i] thread Shooot( "WEAPON_NAME" );
}

Shooot( PassWeap )
{
for(;;)
{
self waittill( "trigger" );
                Weap = self GetCurrentWeapon();
if( Weap == PassWeap )
break;
else
continue;
                wait .05;
}
// What you want done here
}
Last Edit: May 23, 2014, 09:01:39 pm by PROxFTW
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Code Snippet
Plaintext
Script()
{
Trig = GetEntArray( "ENT", "targetname" );
for( i = 0; i < Trig.size; i++ )
Trig[i] thread Shooot( "WEAPON_NAME" );
}

Shooot( PassWeap )
{
for(;;)
{
self waittil( "trigger" );
                Weap = self GetWeaponListPrimaries();
if( Weap[0] == PassWeap )
break;
else
continue;
}
// What you want done here
}

Wouldn't this work better for getting what weapon the player has? http://www.zeroy.com/script/player/getcurrentweapon.htm
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Wouldn't this work better for getting what weapon the player has? http://www.zeroy.com/script/player/getcurrentweapon.htm
Yah thanks deadra, just a bit tired.
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
so is my theory correct? i was going to test it like a week and a half ago but i had to reinstall mod tools again :(  :'(
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
so is my theory correct? i was going to test it like a week and a half ago but i had to reinstall mod tools again :(  :'(
Yah don't know if it is a trigger_shoot but I don't remember haven't messed with mod tools for a while.
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
trigger_damage

- Phil.
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 29 August 2012
Last active: 8 years ago
Posts
366
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
haxman123's Groups
haxman123's Contact & Social Links
Yeah what Ya-Ph1l Said

Post Merge: May 22, 2014, 09:31:27 am
Yah don't know if it is a trigger_shoot but I don't remember haven't messed with mod tools for a while.

Trigger_damage
Last Edit: May 22, 2014, 09:31:27 am by haxman123
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Code Snippet
Plaintext
Script()
{
Trig = GetEntArray( "ENT", "targetname" );
for( i = 0; i < Trig.size; i++ )
Trig[i] thread Shooot( "WEAPON_NAME" );
}

Shooot( PassWeap )
{
for(;;)
{
self waittil( "trigger" );
                Weap = self GetCurrentWeapon();
if( Weap == PassWeap )
break;
else
continue;
}
// What you want done here
}

There is a typo on the waittill("trigger") and it would be GetWeaponsListPrimaries, and I'm not sure if you can GetWeaponListPrimaries from the trigger. I like that you thought to getentarray instead of just getting one. May I suggest the following modifications:
Code Snippet
Plaintext
//thread shootme();
shootme(){
triggers = GetEntArray( "ENT", "targetname" );
for( i = 0; i < triggers.size; i++ ){
triggers[i] thread shotit("zombie_colt");
}
}
shotit(weapon){
currentgun = "";
while(!(currentgun==weapon)){
self waittill("trigger", player);
currentgun = player GetCurrentWeapon();
}
//Do what you want here
}
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
There is a typo on the waittill("trigger") and it would be GetWeaponsListPrimaries, and I'm not sure if you can GetWeaponListPrimaries from the trigger. I like that you thought to getentarray instead of just getting one. May I suggest the following modifications:
Code Snippet
Plaintext
//thread shootme();
shootme(){
triggers = GetEntArray( "ENT", "targetname" );
for( i = 0; i < triggers.size; i++ ){
triggers[i] thread shotit("zombie_colt");
}
}
shotit(weapon){
currentgun = "";
while(!(currentgun==weapon)){
self waittill("trigger", player);
currentgun = player GetCurrentWeapon();
}
//Do what you want here
}
Yah all the mistakes were made because I was a bit tired making this, like I said to deadra, so I wouldn't be hurt if there were mistakes.
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
ill add the script this weekend and let you know how it worked.  :)
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
ok cant wait

 
Loading ...