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

trigger that give you a weapon

broken avatar :(
Created 10 years ago
by aster-99
0 Members and 1 Guest are viewing this topic.
2,191 views
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 4 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
is the quality of ours convictions to determine success
×
aster-99's Groups
aster-99's Contact & Social Links
hi, i'm doing a little EE in my map. the first step is to shoot to a horse (don't ask me why) for keep a thundergun for free.
so i put a trigger damage wich targetname thun_trigger
thats are all script i put in the zombiemode.gsc
first i declared the first step thread
Code Snippet
Plaintext
thread passo1();
after i used this for keep the trigger signal
Code Snippet
Plaintext
level.tun = 0;
tun_trigger = getEnt("tun_trigger", "targetname");
tun_trigger thread passo1();
that's the final part of the script, but it don't give me the thundergun, i think because it doesn't know wich player give the weapon
Code Snippet
Plaintext
passo1()
{
self setCursorHint("HINT_NOICON");
self waittill("trigger");
level.player giveWeapon( "thunderg" );

self delete();

level.tun = 1;  //this is for unlock the second part of the EE
}
someone can help me???
Last Edit: June 27, 2014, 02:23:23 pm by aster-99
Marked as best answer by aster-99 10 years ago
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
You are correct, the game doesn't know who level.player is. Replace your wait till function with this:
Code Snippet
Plaintext
self waittill("trigger", player);
This will define player as the player who hit the trigger, then change level.player to player.
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 4 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
aster-99's Groups
aster-99's Contact & Social Links
i tried your version, but it still don't give me the thundergun

Post Merge: June 27, 2014, 04:04:14 pm
wooops, i don't read to change level.player to player. now all works perfectly, really thanks!
Last Edit: June 27, 2014, 04:16:16 pm by aster-99
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
i tried your version, but it still don't give me the thundergun

Code Snippet
Plaintext
self waittill("trigger",player);
if(level.tun == 0)
{
player takeWeapon( player getCurrentWeapon() );
player giveWeapon("thundergun");
player switchToWeapon("thundergun");
level.tun = 1;
}
Can remove if statement but it's your call.
[/quote]
Last Edit: June 27, 2014, 04:05:55 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Code Snippet
Plaintext
self waittill("trigger",player);
if(level.tun == 0)
{
player takeWeapon( player getCurrentWeapon() );
player giveWeapon("thundergun");
player switchToWeapon("thundergun");
level.tun = 1;
}
Can remove if statement but it's your call.
I wouldn't consider this proper as it does not check the player's inventory size. If they only had one weapon this would not put the thundergun in the second slot. There is already a function for giving weapons, which is maps\_zombiemode_weapons::weapon_give(weaponname).
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I wouldn't consider this proper as it does not check the player's inventory size. If they only had one weapon this would not put the thundergun in the second slot. There is already a function for giving weapons, which is maps\_zombiemode_weapons::weapon_give(weaponname).
That's true, but expected him to have already done that but oh well.

 
Loading ...