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

Have uses for an item & button to activate?

broken avatar :(
Created 7 years ago
by HyperFirez
0 Members and 1 Guest are viewing this topic.
2,732 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Maps:
Standoff Zombies [WIP]
Der Blitzdrache [WIP] (Maybe Canceled)
FNAF 1-4 [WIP] (Maybe Canceled)
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
I am looking for a way to assign a button on the keyboard/controller that will activate an object that has multiple uses, and after all the uses are used, it removes the item from your inventory. Any help is appreciated!
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
You could use the actionslots, and check when a player is using them

for example
Code Snippet
Plaintext
player SetActionSlot( 4, "weapon", "c4" );
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
You could use the actionslots, and check when a player is using them

for example
Code Snippet
Plaintext
player SetActionSlot( 4, "weapon", "c4" );
Awesome!
Now I just need to know how to make it have limited uses.

Double Post Merge: December 26, 2016, 02:59:48 am
If it helps any, this is my script: http://paste.md-5.net/sijedosiqa.coffee
Last Edit: December 26, 2016, 02:59:48 am by HyperFirez
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
I still need help...
Marked as best answer by HyperFirez 7 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Cant you just set the maxammo of that 'weapon' to the number of max uses you want?
You could check in your script if the ammocount is 0 and if it is take the 'weapon' from the player.

Spoiler: click to open...
If you want to make sure players dont get a max ammo and refill their gumballs, change the max-ammo script in _powerups into this:

Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
if( !is_excluded_weapon( primaryWeapons[x] ) )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

is_excluded_weapon( weapon )
{
is_excluded = false;

switch( weapon )
{
case "gumball_1":
case "gumball_2":
is_excluded = true;
break;

default:
break;
}

return is_excluded;
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
I don't want to set the amount of ammo a weapon has. I want to limit the amount of powerups that spawn. If you couldn't tell, I am making a gobblegum script. The "Cache Back" gobblegum, lets you spawn in 3 max ammos. I want to make it after that 3rd use, it takes the gumball away from you.
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 9 months ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere'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 Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I don't want to set the amount of ammo a weapon has. I want to limit the amount of powerups that spawn. If you couldn't tell, I am making a gobblegum script. The "Cache Back" gobblegum, lets you spawn in 3 max ammos. I want to make it after that 3rd use, it takes the gumball away from you.

Ammo = uses
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
Ammo = uses
Ah! I didn't see the single quotes!

 
Loading ...