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

Buyable trigger

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
1,808 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 to activate when i buy with certain amount of points
Marked as best answer by pashan 12 years ago
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Here you go, this is untested, but you'll see if it works and if it not works, then I'll try to fix it.
This only makes so when you hit the trigger, it will take 1000 points from you, but you asked for a buyable trigger so yea ;).
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

buyable()
{
buyable_trigger = getEnt("buyable_trigger","targetname");
player = getplayers();
cost = 1000;// change this for how much you want it to cost

for(i=0;i<buyable_trigger.size;i++)
{
buyable_trigger[i] setCursorHint("HINT_NOICON");
buyable_trigger[i] setHintString("Press &&1 to pay trigger [Cost: "+cost+"]");
buyable_trigger[i] waittill("trigger",player);

if(player.score >= cost)
{
player maps\_zombiemode_score::minus_to_player_score( cost );
buyable_trigger[i] delete();
}
}
}
Last Edit: March 30, 2014, 05:41:25 pm by Ege115
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
Code Snippet
Plaintext
for (i = 0; i < buyable_trigger.size; i++)
with a non-array?
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Code Snippet
Plaintext
for (i = 0; i < buyable_trigger.size; i++)
with a non-array?
Oops! Changing now. Thanks Jei for paying attention ;).
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.
It works thanks

 
Loading ...