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

Perk limit

broken avatar :(
Created 8 years ago
by tudark
0 Members and 1 Guest are viewing this topic.
1,236 views
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 26 July 2013
Last active: 7 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Action is the enemy of thought
Signature
×
tudark's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
tudark's Contact & Social Linkstudark71The Morgue
solved
Last Edit: May 18, 2016, 01:46:04 am by tudark
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 26 July 2013
Last active: 7 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Action is the enemy of thought
×
tudark's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
tudark's Contact & Social Linkstudark71The Morgue
In _zombiemode_perks.gsc
Code Snippet
Plaintext
set_zombie_var( "max_perks",						4 );							// Set to how many perks you want to initially limit the players to

Most people like a buyable perk slot. If you are interested in a buyable perk slot:
Spoiler: click to open...
Code Snippet
Plaintext
buy_perk_slot()
{
perk_slot_trigger = getEnt( "perk_slot_trigger", "targetname" );
level.buy_slot_cost = 5000; //Cost of perk slot, feel free to change
perk_slot_trigger SetCursorHint("HINT_NOICON"); //Gets rid of hand symbol
perk_slot_trigger UseTriggerRequireLookAt(); //Requires the player to look at the trigger to use it
perk_slot_trigger SetHintString("Press &&1 To Buy Perk Slot [Cost: " + level.buy_slot_cost + "]"); //Hint string players will see

while(1) //Loops so players can use it more than once
{
perk_slot_trigger waittill( "trigger", player ); //Waits until player uses trigger

if(player.score >= level.buy_slot_cost) //Checks to see if the player has enough points
{
player maps\_zombiemode_score::minus_to_player_score( level.buy_slot_cost ); //Subtracts the cost from the player's score
player.max_perks++;; //Increases the player's perk limit by 1
perk_slot_trigger SetHintString("You Have Bought Another Perk Slot"); //Displays this message to the player
playsoundatposition("cha_ching", perk_slot_trigger.origin);
wait 3;
perk_slot_trigger SetHintString("Press &&1 To Buy Perk Slot [Cost: " + level.buy_slot_cost + "]");
}
}
}

Instuctions:
1) copy the code and paste to the bottom of mapname.gsc
2) in mapname.gsc look for the function
Code Snippet
Plaintext
maps\_zombiemode::main();
under that add:
Code Snippet
Plaintext
thread buy_perk_slot();
3) add a trigger_use in radiant and give it the kvps: targetname-perk_slot_trigger
sounds good I will try it .

 
Loading ...