Advertisement
Guest User

Perk limit increasing script

a guest
Apr 20th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.81 KB | None | 0 0
  1. buyable_perk_slot()
  2.     {
  3.         level.perk_limit = 4; //Initial perk limit
  4.         level.perk_limit_max = 8;
  5.         level.buy_slot_cost = 1500; //Cost of perk slot
  6.         buy_slot_trigger = getent( "buy_slot_trigger" , "targetname" ); //Calls the trigger into script
  7.         perk_bottle = Spawn( "script_model", self.origin ); //Spawns a model and gives it the script name perk_bottle
  8.         perk_bottle.angles = (-30,0,-30); //Sets the angles of the perk_bottle
  9.         perk_bottle setmodel( "zombie_perk_bottle_jugg" ); //Sets the model to a juggernog bottle
  10.         self thread perk_bottle_rotate( perk_bottle );
  11.        
  12.        
  13.         playfxontag (level._effect["powerup_on"], perk_bottle, "tag_origin"); //Puts the powerup effect around the bottle
  14.        
  15.         buy_slot_trigger SetCursorHint("HINT_NOICON"); //Gets rid of hand symbol
  16.         self UseTriggerRequireLookAt(); //Requires the player to look at the trigger to use it
  17.         buy_slot_trigger SetHintString("Press &&1 To Buy Perk Slot [Cost: 1500]"); //Hint string players will see
  18.        
  19.         while(1) //Loops so players can use it more than once
  20.             {
  21.                 self waittill( "trigger", player );
  22.            
  23.        
  24.         if(player.score >= level.buy_slot_cost) //Checks to see if the player has enough points
  25.             {
  26.                 player maps\_zombiemode_score::minus_to_player_score( level.buy_slot_cost ); //Subtracts the cost from the player's score
  27.                 level.perk_limit = level.perk_limit + 1; //Increases the player's perk limit by 1
  28.                 iprintlnbold( "Perk Slot Increased By 1" ); //Displays this message to the player
  29.            
  30.        
  31.         if(level.perk_limit >= level.perk_limit_max) //Lets the player know if they have reached the max perk limit
  32.             {
  33.                 iprintlnbold( "Max Perk Limit Reached" );
  34. }
  35. }
  36. }
  37.  
  38. }
  39.  
  40. perk_bottle_rotate( perk_bottle )
  41. {  
  42.     self endon( "took_gun" );
  43.     self endon( "disconnect" );
  44.     while(1)
  45.     {
  46.     perk_bottle rotateyaw( 360 ,1.5 );
  47.     wait 1.5;
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement