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

Requesting One Script

broken avatar :(
Created 9 years ago
by Andy Whelan
0 Members and 1 Guest are viewing this topic.
1,533 views
broken avatar :(
×
broken avatar :(
True Blue Elite
Location: auAustralia
Date Registered: 8 February 2015
Last active: 8 months ago
Posts
688
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Still Kickin'
Signature


×
Andy Whelan's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Andy Whelan's Contact & Social LinksAndyWhelanAndyWhelan01AndyWhelan
Sup,
So I am in need of a script for buying ammo, no not a max ammo. One where there are triggers all over the map and each can only be bought once, like the ones in Zombie Seelow and I think TMG Castle.


Cheers,
With Kind Regards,
Andy Whelan
Marked as best answer by Andy Whelan 9 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
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
Sup,
So I am in need of a script for buying ammo, no not a max ammo. One where there are triggers all over the map and each can only be bought once, like the ones in Zombie Seelow and I think TMG Castle.


Cheers,
With Kind Regards,
Andy Whelan

I have not seen these maps or the ammo purchase, are they something like this?

Code Snippet
Plaintext
BuyAmmoOnce(){
//This function can be added to your mapname.gsc
//thread BuyAmmoOnce();//add this up in function threads
trigs = getentarray("ammotrig","targetname");//change ammotrig to your triggers kvps
for(i=0;i<trigs.size;i++){
trigs[i] thread OneTimeAmmo();
}
}
OneTimeAmmo(){
cost = 500;
if(isdefined(self.zombie_cost)) cost = self.zombie_cost;//can set up different prices per trigger
self setCursorHint("HINT_NOICON");
self sethintstring("Press &&1 to buy ammo [Cost: " + cost + "]");
while(1){
self waittill("trigger",player);
if(player.score+5>=cost){
current_weapon = player getCurrentWeapon();
if(WeaponType( current_weapon ) != "grenade"){
player maps\_zombiemode_score::minus_to_player_score( cost );
player PlayLocalSound("cha_ching");
player giveMaxAmmo(current_weapon);
break;
}
player iprintlnbold("No ammo for grenades"); //delete this after testing
}else{
player PlayLocalSound("no_cha_ching");
}
wait(.5);
}
if(isdefined(self.target)){
ammoBox = getent(self.target,"targetname");//the target kvp for trigger and targetname of script_model
ammoBox delete();
}
self delete();
}
Last Edit: June 10, 2015, 12:22:19 pm by MakeCents
broken avatar :(
×
broken avatar :(
True Blue Elite
Location: auAustralia
Date Registered: 8 February 2015
Last active: 8 months ago
Posts
688
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Still Kickin'
×
Andy Whelan's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Andy Whelan's Contact & Social LinksAndyWhelanAndyWhelan01AndyWhelan
I have not seen these maps or the ammo purchase, are they something like this?

Code Snippet
Plaintext
BuyAmmoOnce(){
//This function can be added to your mapname.gsc
//thread BuyAmmoOnce();//add this up in function threads
trigs = getentarray("ammotrig","targetname");//change ammotrig to your triggers kvps
for(i=0;i<trigs.size;i++){
trigs[i] thread OneTimeAmmo();
}
}
OneTimeAmmo(){
cost = 500;
if(isdefined(self.zombie_cost)) cost = self.zombie_cost;//can set up different prices per trigger
self setCursorHint("HINT_NOICON");
self sethintstring("Press &&1 to buy ammo [Cost: " + cost + "]");
while(1){
self waittill("trigger",player);
if(player.score+5>=cost){
current_weapon = player getCurrentWeapon();
if(WeaponType( current_weapon ) != "grenade"){
player maps\_zombiemode_score::minus_to_player_score( cost );
player PlayLocalSound("cha_ching");
player giveMaxAmmo(current_weapon);
break;
}
player iprintlnbold("No ammo for grenades"); //delete this after testing
}else{
player PlayLocalSound("no_cha_ching");
}
wait(.5);
}
self delete();
}

That does look like it would work, I'll give it a try. Thanks

Double Post Merge: June 10, 2015, 11:31:50 am
The script works perfectly, thank you very much. But one more with, how would I make it so the ammo box model disappear?
Last Edit: June 10, 2015, 11:31:50 am by Andy Whelan
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
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
That does look like it would work, I'll give it a try. Thanks

Double Post Merge: June 10, 2015, 11:31:50 am
The script works perfectly, thank you very much. But one more with, how would I make it so the ammo box model disappear?

If you are using an ammo box script_model to represent the trigger, you can set it as the target of the trigger, using w, so it is auto numbered, which will allow you to make one prefab and just copy it everywhere you want it, and then just add this:
Code Snippet
Plaintext
	ammoBox = getent(self.target,"targetname");
ammoBox delete();
Right above:
Code Snippet
Plaintext
	self delete();

I updated the original response to prevent confusion
Last Edit: June 10, 2015, 12:21:23 pm by MakeCents

 
Loading ...