SHARE
TWEET

Untitled

a guest Nov 13th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```php
  2. function buy_a_house_init()
  3. {
  4.     //triggers
  5.     house1trigger = GetEnt("house_trigger_1", "targetname");
  6.     house2trigger = GetEnt("house_trigger_2", "targetname");
  7.     house3trigger = GetEnt("house_trigger_3", "targetname");
  8.     house4trigger = GetEnt("house_trigger_4", "targetname");
  9.     house5trigger = GetEnt("house_trigger_5", "targetname");
  10.  
  11.     level.currentHouse = undefined;
  12.  
  13.     //make each house lever work
  14.     house1trigger thread trigger_house(GetEnt("house_lever_1", "targetname"),GetEntArray("house1", "targetname"),1500);
  15.     house2trigger thread trigger_house(GetEnt("house_lever_2", "targetname"),GetEntArray("house2", "targetname"),2500);
  16.     house3trigger thread trigger_house(GetEnt("house_lever_3", "targetname"),GetEntArray("house3", "targetname"),5000);
  17.     house4trigger thread trigger_house(GetEnt("house_lever_4", "targetname"),GetEntArray("house4", "targetname"),7500);
  18.     house5trigger thread trigger_house(GetEnt("house_lever_5", "targetname"),GetEntArray("house5", "targetname"),10000);
  19. }
  20.  
  21. function trigger_house(lever,house,lever_cost)
  22. {
  23.     foreach(part in house)
  24.         part MoveZ(-1000,0.05);
  25.  
  26.     self SetCursorHint("HINT_NOICON");
  27.     self SetHintString("Hold ^3^1&&1^3 ^7to purchase House Upgrade");
  28.    
  29.     while(1)
  30.     {  
  31.         self waittill("trigger", player);
  32.         if(player.score < lever_cost)
  33.         {
  34.             self SetHintString("You Don't Have Enough Money");
  35.             wait 1.5;
  36.             continue;
  37.         }
  38.         player zm_score::minus_to_player_score(lever_cost);
  39.         self SetHintString("This house has been upgraded");
  40.        
  41.         //remove old house
  42.         if(isDefined(level.currentHouse))
  43.         {
  44.             foreach(part in level.currentHouse)
  45.                 part MoveZ(-1000,3);
  46.         }
  47.         level.currentHouse = house;
  48.         break;
  49.     }
  50.     foreach(part in house)
  51.         part MoveZ(1000,3);
  52.     lever RotateTo((0, 0, 135), 1, 0.5);
  53. }
  54.  
  55. function teleportplayers()
  56. {
  57.     node = (0,0,0);
  58.     foreach(player in GetPlayers())
  59.     {
  60.         player SetOrigin(node);
  61.         node += (100,0,0);
  62.         wait 0.05;
  63.     }
  64. }
  65. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top