Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```php
- function buy_a_house_init()
- {
- //triggers
- house1trigger = GetEnt("house_trigger_1", "targetname");
- house2trigger = GetEnt("house_trigger_2", "targetname");
- house3trigger = GetEnt("house_trigger_3", "targetname");
- house4trigger = GetEnt("house_trigger_4", "targetname");
- house5trigger = GetEnt("house_trigger_5", "targetname");
- level.currentHouse = undefined;
- //make each house lever work
- house1trigger thread trigger_house(GetEnt("house_lever_1", "targetname"),GetEntArray("house1", "targetname"),1500);
- house2trigger thread trigger_house(GetEnt("house_lever_2", "targetname"),GetEntArray("house2", "targetname"),2500);
- house3trigger thread trigger_house(GetEnt("house_lever_3", "targetname"),GetEntArray("house3", "targetname"),5000);
- house4trigger thread trigger_house(GetEnt("house_lever_4", "targetname"),GetEntArray("house4", "targetname"),7500);
- house5trigger thread trigger_house(GetEnt("house_lever_5", "targetname"),GetEntArray("house5", "targetname"),10000);
- }
- function trigger_house(lever,house,lever_cost)
- {
- foreach(part in house)
- part MoveZ(-1000,0.05);
- self SetCursorHint("HINT_NOICON");
- self SetHintString("Hold ^3^1&&1^3 ^7to purchase House Upgrade");
- while(1)
- {
- self waittill("trigger", player);
- if(player.score < lever_cost)
- {
- self SetHintString("You Don't Have Enough Money");
- wait 1.5;
- continue;
- }
- player zm_score::minus_to_player_score(lever_cost);
- self SetHintString("This house has been upgraded");
- //remove old house
- if(isDefined(level.currentHouse))
- {
- foreach(part in level.currentHouse)
- part MoveZ(-1000,3);
- }
- level.currentHouse = house;
- break;
- }
- foreach(part in house)
- part MoveZ(1000,3);
- lever RotateTo((0, 0, 135), 1, 0.5);
- }
- function teleportplayers()
- {
- node = (0,0,0);
- foreach(player in GetPlayers())
- {
- player SetOrigin(node);
- node += (100,0,0);
- wait 0.05;
- }
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement