SHARE
TWEET

Untitled

a guest Oct 13th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #0.2.4
  2.  
  3.  
  4.  
  5. options:
  6.    
  7.     config-loc: plugins/ThePIT/config.yml
  8.    
  9.     messages-loc: plugins/ThePIT/messages.yml
  10.    
  11.     sb-loc: plugins/ThePIT/scoreboard.yml      
  12.    
  13.     titles-loc: plugins/ThePIT/titles.yml  
  14.        
  15.  
  16. on script load:
  17.     set {_&} to "&"
  18.     if yaml value "chat-enable" from file "{@config-loc}" is not set:
  19.         set yaml value "chat-enable" from file "{@config-loc}" to "true"
  20.     if yaml value "bungeecord" from file "{@config-loc}" is not set:
  21.         set yaml value "bungeecord" from file "{@config-loc}" to "false"          
  22.     if yaml value "chat-format" from file "{@config-loc}" is not set:  
  23.         set yaml value "chat-format" from file "{@config-loc}" to "%{_&}%7[%{_&}%e[level]%{_&}%7] [player] %{_&}%8%{_&}%l- %{_&}%7[message]"
  24.     if yaml value "SHOP-ID" from file "{@config-loc}" is not set:
  25.         set yaml value "SHOP-ID" from file "{@config-loc}" to 0
  26.     if yaml value "UPGRADE-ID" from file "{@config-loc}" is not set:
  27.         set yaml value "UPGRADE-ID" from file "{@config-loc}" to 1
  28.     if yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" is not set:
  29.         set yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" to "true"    
  30.     if yaml value "LEVE-UP-SOUND" from file "{@config-loc}" is not set:
  31.         set yaml value "LEVE-UP-SOUND" from file "{@config-loc}" to "LEVEL_UP"
  32.     if yaml value "KILL-SOUND" from file "{@config-loc}" is not set:
  33.         set yaml value "KILL-SOUND" from file "{@config-loc}" to "ORB_PICKUP"  
  34.        
  35.     if yaml list "ENABLED-WORLDS" from file "{@config-loc}" is not set:
  36.         add "world" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
  37.         add "thepit" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
  38.  
  39.     if yaml value "KILL-XP" from file "{@config-loc}" is not set:
  40.         set yaml value "KILL-XP" from file "{@config-loc}" to 15
  41.        
  42.     if yaml value "KILL-GOLD" from file "{@config-loc}" is not set:
  43.         set yaml value "KILL-GOLD" from file "{@config-loc}" to 10
  44.        
  45.     if yaml value "ASSIST-XP" from file "{@config-loc}" is not set:
  46.         set yaml value "ASSIST-XP" from file "{@config-loc}" to 10
  47.        
  48.     if yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" is not set:
  49.         set yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" to 50
  50.        
  51.     if yaml value "ASSIST-GOLD" from file "{@config-loc}" is not set:
  52.         set yaml value "ASSIST-GOLD" from file "{@config-loc}" to 5
  53.        
  54.     if yaml value "prefix" from file "{@messages-loc}" is not set:
  55.         set yaml value "prefix" from file "{@messages-loc}" to "%{_&}%e%{_&}%lTHE PIT %{_&}%8%{_&}%l- %{_&}%7"
  56.        
  57.     if yaml value "kill-message" from file "{@messages-loc}" is not set:
  58.         set yaml value "kill-message" from file "{@messages-loc}" to "%{_&}%aKILL! %{_&}%7on [%{_&}%e[level]%{_&}%7] [victim] %{_&}%b%{_&}%l+[xp]XP %{_&}%6%{_&}%l+[gold]"    
  59.        
  60.     if yaml value "assist-message" from file "{@messages-loc}" is not set:
  61.         set yaml value "assist-message" from file "{@messages-loc}" to "%{_&}%aASSIST! %{_&}%7on [%{_&}%e[level]%{_&}%7] [player] %{_&}%b%{_&}%l+[xp]XP %{_&}%6%{_&}%l+[gold]"
  62.        
  63.     if yaml value "kill-streak" from file "{@messages-loc}" is not set:
  64.         set yaml value "kill-streak" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSTREAK! %{_&}%7of %{_&}%c[streak] %{_&}%7by [level] [player]"  
  65.  
  66.     if yaml value "level-up" from file "{@messages-loc}" is not set:
  67.         set yaml value "level-up" from file "{@messages-loc}" to "%{_&}%3%{_&}%lLEVEL UP! %{_&}%7[%{_&}%e[level]%{_&}%7]"  
  68.        
  69.     if yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" is not set:
  70.         set yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" to "%{_&}%cYou need level [level] to use ender chest!"        
  71.  
  72.     if yaml value "item-purchase" from file "{@messages-loc}" is not set:
  73.         set yaml value "item-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASE! %{_&}%6[item]"
  74.        
  75.     if yaml value "perk-purchase" from file "{@messages-loc}" is not set:      
  76.         set yaml value "perk-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASED PERK!"
  77.        
  78.     if yaml value "perk-selected" from file "{@messages-loc}" is not set:      
  79.         set yaml value "perk-selected" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSELECTED PERK"        
  80.        
  81.     if yaml value "no-gold" from file "{@messages-loc}" is not set:    
  82.         set yaml value "no-gold" from file "{@messages-loc}" to "%{_&}%c%{_&}%lNOT ENOUGHT GOLD!"      
  83.  
  84.     if yaml value "in-game" from file "{@messages-loc}" is not set:    
  85.         set yaml value "in-game" from file "{@messages-loc}" to "%{_&}%aYou are in game."  
  86.  
  87.     if yaml value "not-in-game" from file "{@messages-loc}" is not set:    
  88.         set yaml value "not-in-game" from file "{@messages-loc}" to "%{_&}%c%{_&}%lYou are not in game."  
  89.  
  90.     if yaml value "in-fight-status" from file "{@messages-loc}" is not set:    
  91.         set yaml value "in-fight-status" from file "{@messages-loc}" to "%{_&}%3%{_&}%lYou are in %{_&}%cFighting %{_&}%3status."  
  92.        
  93.     if yaml value "level-up-title" from file "{@titles-loc}" is not set:      
  94.         set yaml value "level-up-title" from file "{@titles-loc}" to "%{_&}%b%{_&}%lLEVEL UP!"    
  95.  
  96.     if yaml value "level-up-subtitle" from file "{@titles-loc}" is not set:    
  97.         set yaml value "level-up-subtitle" from file "{@titles-loc}" to "%{_&}%7[%{_&}%e[old]%{_&}%7] %{_&}%3%{_&}%l-> %{_&}%7[%{_&}%e[new]%{_&}%7]"  
  98.        
  99.     if yaml value "death-title" from file "{@titles-loc}" is not set:  
  100.         set yaml value "death-title" from file "{@titles-loc}" to "%{_&}%c%{_&}%lYOU DIED"
  101.        
  102.     if yaml value "death-subtitle" from file "{@titles-loc}" is not set:  
  103.         set yaml value "death-subtitle" from file "{@titles-loc}" to "%{_&}%e"
  104.        
  105.     if yaml value "website" from file "{@sb-loc}" is not set:  
  106.         set yaml value "website" from file "{@sb-loc}" to "%{_&}%eMC.SERVER.ORG"
  107.  
  108.        
  109.     delete {THEPIT::*}
  110.     set {THEPIT::CONFIG::CHAT} to yaml value "chat-enable" from file "{@config-loc}"
  111.     set {THEPIT::CONFIG::CHAT-FORMAT} to yaml value "chat-format" from file "{@config-loc}"
  112.     set {THEPIT::CONFIG::BUNGEECORD} to yaml value "bungeecord" from file "{@config-loc}"
  113.     set {THEPIT::CONFIG::SHOP-ID} to yaml value "SHOP-ID" from file "{@config-loc}"
  114.     set {THEPIT::CONFIG::UPGRADE-ID} to yaml value "UPGRADE-ID" from file "{@config-loc}"
  115.     set {THEPIT::CONFIG::PRESSURE-PLATE} to yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}"
  116.     set {THEPIT::CONFIG::LEVE-UP-SOUND} to yaml value "LEVE-UP-SOUND" from file "{@config-loc}"
  117.     set {THEPIT::CONFIG::KILL-SOUND} to yaml value "KILL-SOUND" from file "{@config-loc}"      
  118.     set {THEPIT::CONFIG::ENABLED-WORLDS::*} to yaml list "ENABLED-WORLDS" from file "{@config-loc}"    
  119.     set {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL} to yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}"
  120.    
  121.     set {THEPIT::CONFIG::KILL-XP} to yaml value "KILL-XP" from file "{@config-loc}"    
  122.     set {THEPIT::CONFIG::KILL-GOLD} to yaml value "KILL-GOLD" from file "{@config-loc}"
  123.     set {THEPIT::CONFIG::ASSIST-XP} to yaml value "ASSIST-XP" from file "{@config-loc}"    
  124.     set {THEPIT::CONFIG::ASSIST-GOLD} to yaml value "ASSIST-GOLD" from file "{@config-loc}"
  125.    
  126.     set {THEPIT::MESSAGES::PREFIX} to yaml value "prefix" from file "{@messages-loc}"
  127.     set {THEPIT::MESSAGES::KILL} to yaml value "kill-message" from file "{@messages-loc}"
  128.     set {THEPIT::MESSAGES::ASSIST} to yaml value "assist-message" from file "{@messages-loc}"  
  129.     set {THEPIT::MESSAGES::STREAK} to yaml value "kill-streak" from file "{@messages-loc}"
  130.     set {THEPIT::MESSAGES::LEVEL-UP} to yaml value "level-up" from file "{@messages-loc}"  
  131.     set {THEPIT::MESSAGES::ITEM-PURCHASE} to yaml value "item-purchase" from file "{@messages-loc}"    
  132.     set {THEPIT::MESSAGES::PERK-PURCHASE} to yaml value "perk-purchase" from file "{@messages-loc}"    
  133.     set {THEPIT::MESSAGES::SELECTED-PERK} to yaml value "perk-selected" from file "{@messages-loc}"    
  134.     set {THEPIT::MESSAGES::NO-GOLD} to yaml value "no-gold" from file "{@messages-loc}"
  135.     set {THEPIT::MESSAGES::IN-GAME} to yaml value "in-game" from file "{@messages-loc}"    
  136.     set {THEPIT::MESSAGES::NOT-IN-GAME} to yaml value "not-in-game" from file "{@messages-loc}"    
  137.     set {THEPIT::MESSAGES::YOU-ARE-IN-FIGHT} to yaml value "in-fight-status" from file "{@messages-loc}"  
  138.     set {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG} to yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}"  
  139.    
  140.     set {THEPIT::TITLES::LEVEL-UP-TITLE} to yaml value "level-up-title" from file "{@titles-loc}"  
  141.     set {THEPIT::TITLES::LEVEL-UP-SUBTITLE} to yaml value "level-up-subtitle" from file "{@titles-loc}"
  142.     set {THEPIT::TITLES::DEATH-TITLE} to yaml value "death-title" from file "{@titles-loc}"
  143.     set {THEPIT::TITLES::DEATH-SUBTITLE} to yaml value "death-subtitle" from file "{@titles-loc}"  
  144.    
  145.     set {THEPIT::SB::WEBSITE} to yaml value "website" from file "{@sb-loc}"
  146.  
  147.    
  148.        
  149. function pit_join(p: player):
  150.     set {_uuid} to uuid of {_p}
  151.     set {pit.%{_uuid}%.state} to "ingame"
  152.     teleport {_p} to {pit.spawn}
  153.     if {pit.%{_uuid}%.level} is not set:
  154.         set {pit.%{_uuid}%.level} to 1
  155.     if {pit.%{_uuid}%.xp} is not set:
  156.         set {pit.%{_uuid}%.xp} to 0    
  157.     if {pit.%{_uuid}%.xp-need} is not set:
  158.         set {pit.%{_uuid}%.xp-need} to 100
  159.     if {pit.%{_uuid}%.gold} is not set:
  160.         set {pit.%{_uuid}%.gold} to 0  
  161.     set {pit.%{_uuid}%.streak} to 0
  162.     set {pit.%{_uuid}%.status} to "&aIdling"
  163.     pit_clear({_p})
  164.     pit_updatetag({_p})
  165.     pit_equip({_p})
  166.    
  167. function pit_leave(p: player):
  168.     set {_uuid} to uuid of {_p}
  169.     delete stylish scoreboard "PIT-%{_p}%"
  170.     delete {pit.%{_uuid}%.streak}
  171.     delete {pit.%{_uuid}%.state}
  172.     delete {pit.%{_uuid}%.damage::*}
  173.     pit_clear({_p})
  174.     make console execute command "nte player %{_p}% clear"    
  175.     teleport {_p} to {pit.leave}
  176.    
  177.    
  178. function pit_clear(p: player):
  179.     clear {_p}'s inventory
  180.     clear {_p}'s level
  181.     remove all effects from {_p}  
  182.  
  183. on join:
  184.     if {THEPIT::CONFIG::BUNGEECORD} is "true":
  185.         pit_join(player)
  186.         stop
  187.     else:
  188.         stop
  189.        
  190. command /pit [<text>] [<player>] [<integer>]:
  191.     trigger:
  192.         if arg-1 is "join":
  193.             if {pit.%uuid of player%.state} is not set:
  194.                 pit_join(player)
  195.                 stop
  196.             else:
  197.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::IN-GAME}%"
  198.                 stop  
  199.         if arg-1 is "leave":
  200.             if {THEPIT::CONFIG::BUNGEECORD} is "false":
  201.                 if {pit.%uuid of player%.state} is "ingame":
  202.                     pit_leave(player)
  203.                     stop
  204.                 else:
  205.                     send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NOT-IN-GAME}%"
  206.                     stop
  207.             else:
  208.                 stop
  209.         if arg-1 is "setgold":
  210.             if player has permission "PIT.SETGOLD":    
  211.                 if arg-2 is set:
  212.                     if arg-3 is set:
  213.                         set {pit.%uuid of arg-2%.gold} to arg-3
  214.                         send "%colored {THEPIT::MESSAGES::PREFIX}% &7Setted &b%arg-2%&b's &6&lGold &7have been set to &c%arg-3%"  
  215.                         stop
  216.                     else:
  217.                         send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"    
  218.                         stop
  219.                 else:
  220.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
  221.                     stop
  222.         if arg-1 is "addgold":
  223.             if player has permission "PIT.ADDGOLD":    
  224.                 if arg-2 is set:
  225.                     if arg-3 is set:
  226.                         add arg-3 to {pit.%uuid of arg-2%.gold}
  227.                         send "%colored {THEPIT::MESSAGES::PREFIX}% &7You added &6&l%arg-3% Gold &7to &c%arg-2%&b's &6&lGold"  
  228.                         stop
  229.                     else:
  230.                         send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"    
  231.                         stop
  232.                 else:
  233.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
  234.                     stop                  
  235.         if arg-1 is "setlevel":
  236.             if player has permission "PIT.SETLEVEL":      
  237.                 if arg-2 is set:
  238.                     if arg-3 is set:
  239.                         if {pit.%uuid of arg-2%.level} is set:
  240.                             set {pit.%uuid of arg-2%.level} to arg-3
  241.                             set {pit.%uuid of arg-2%.xp} to 0
  242.                             set {pit.%uuid of arg-2%.xp-need} to 100*{pit.%uuid of arg-2%.level}
  243.                             pit_updatetag(arg-2)
  244.                             send "%colored {THEPIT::MESSAGES::PREFIX}% &7Setted &b%arg-2%&b's &bLevel &7have been set to &c%arg-3%"
  245.                             stop
  246.                         else:
  247.                             send "%colored {THEPIT::MESSAGES::PREFIX}% &c%arg-2% &anever played"
  248.                             stop
  249.                     else:
  250.                         send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"    
  251.                         stop
  252.                 else:
  253.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
  254.                     stop                  
  255.         if arg-1 is "spawn":
  256.             if {pit.%uuid of player%.state} is "ingame":
  257.                 if {pit.%uuid of player%.status} is "&aIdling":
  258.                     remove all golden_apple from player
  259.                     remove all heads from player
  260.                     teleport player to {pit.spawn}
  261.                     stop
  262.                 else:
  263.                     send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::YOU-ARE-IN-FIGHT}%"
  264.                     stop
  265.             else:
  266.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NOT-IN-GAME}%"
  267.                 stop
  268.         if arg-1 is "setspawn":
  269.             if player has permission "PIT.ADMIN":
  270.                 set {pit.spawn} to player's location
  271.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &cSpawn Set"
  272.                 stop
  273.         if arg-1 is "setshop":
  274.             if player has permission "PIT.ADMIN":
  275.                 if citizen id of target entity is set:
  276.                     set {THEPIT::CONFIG::SHOP-ID} to citizen id of target entity
  277.                     set yaml value "SHOP-ID" from file "{@config-loc}" to citizen id of target entity
  278.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &cShop Set"
  279.                     stop  
  280.                 else:
  281.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &aYou have to look at npc when you execute this command"
  282.                     stop
  283.         if arg-1 is "editmode":
  284.             if player has permission "PIT.EDITMODE":          
  285.                 if {THEPIT::CONFIG::BUNGEECORD} is "true":
  286.                     delete {pit.%uuid of player%.state}
  287.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &cYou are now able to build."
  288.             else:
  289.                 stop                  
  290.         if arg-1 is "setleave":
  291.             if player has permission "PIT.ADMIN":
  292.                 set {pit.leave} to location of player
  293.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &cLeave location set"                  
  294.         if arg-1 is "setupgrade":
  295.             if player has permission "PIT.ADMIN":
  296.                 if citizen id of target entity is set:
  297.                     set {THEPIT::CONFIG::UPGRADE-ID} to citizen id of target entity
  298.                     set yaml value "UPGRADE-ID" from file "{@config-loc}" to citizen id of target entity
  299.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &cShop Set"
  300.                     stop  
  301.                 else:
  302.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &aYou have to look at npc when you execute this command"
  303.                     stop
  304.         else:
  305.             send "&3&l● &7&l------------------------------ &3&l●"  
  306.             send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Join"
  307.             send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Spawn"        
  308.             send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Leave"    
  309.             if player has permission "PIT.ADMIN":
  310.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetGold <PLAYER> <NUMBER>"
  311.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetLevel <PLAYER> <NUMBER>"  
  312.                 if {THEPIT::CONFIG::BUNGEECORD} is "true":
  313.                     send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7EditMode"
  314.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetSpawn"
  315.                 send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetLeave"
  316.                 send "&3&l● &7&l------------------------------ &3&l●"
  317.                 stop
  318.             else:
  319.                 stop
  320.  
  321. on command:
  322.     if {pit.%uuid of player%.state} is "ingame":
  323.         if "%full command%" is "spawn":
  324.             cancel event
  325.             make player execute command "pit spawn"
  326.        
  327.  
  328.  
  329.  
  330. on quit:
  331.     pit_leave(player)
  332.     stop
  333.    
  334.    
  335.    
  336. on pressure plate:
  337.     if {pit.%uuid of player%.state} is "ingame":
  338.         if {THEPIT::CONFIG::PRESSURE-PLATE} is "true":
  339.             cancel event  
  340.             push the player upwards at speed 0.4
  341.             push the player forwards at speed 1.2
  342.         else:
  343.             stop              
  344.     else:
  345.         stop      
  346.    
  347.    
  348.    
  349.    
  350. every second:
  351.     loop all players:
  352.         if {pit.%uuid of loop-player%.state} is "ingame":
  353.             if stylish scoreboard "PIT-%loop-player%" does not exist:
  354.                 create new stylish scoreboard named "PIT-%loop-player%"
  355.                 loop 11 times:
  356.                     create a new id based score "PIT-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "PIT-%loop-player%"
  357.             set {_need} to {pit.%uuid of loop-player%.xp-need}-{pit.%uuid of loop-player%.xp}
  358.             set stylish scoreboard of loop-player to "PIT-%loop-player%"              
  359.             set title of stylish scoreboard "PIT-%loop-player%" to "&e&lTHE PIT"
  360.             set the text of id "PIT-%loop-player%Slot11" to "&7%now%"
  361.             set the text of id "PIT-%loop-player%Slot10" to "&1&e"
  362.             set the text of id "PIT-%loop-player%Slot9" to "&7Level &7[&e%{pit.%uuid of loop-player%.level}%&7]"
  363.             set the text of id "PIT-%loop-player%Slot8" to "&7Needed XP: &b%{_need}%"
  364.             set the text of id "PIT-%loop-player%Slot7" to "&2&9"
  365.             set the text of id "PIT-%loop-player%Slot6" to "&7Gold: &6&l%{pit.%uuid of loop-player%.gold}%"
  366.             set the text of id "PIT-%loop-player%Slot5" to "&3&9"
  367.             set the text of id "PIT-%loop-player%Slot4" to "&7Status: %{pit.%uuid of loop-player%.status}%"
  368.             set the text of id "PIT-%loop-player%Slot3" to "&7Streaks: &a%{pit.%uuid of loop-player%.streak}%"
  369.             set the text of id "PIT-%loop-player%Slot2" to "&4&9"
  370.             set the text of id "PIT-%loop-player%Slot1" to "%colored {THEPIT::SB::WEBSITE}%"
  371.         else if {pit.%uuid of loop-player%.state} is "inevent":
  372.             if stylish scoreboard "PIT-%loop-player%" does not exist:
  373.                 create new stylish scoreboard named "PIT-%loop-player%"
  374.                 loop 11 times:
  375.                     create a new id based score "PIT-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "PIT-%loop-player%"
  376.             set {_need} to {pit.%uuid of loop-player%.xp-need}-{pit.%uuid of loop-player%.xp}
  377.             set stylish scoreboard of loop-player to "PIT-%loop-player%"              
  378.             set title of stylish scoreboard "PIT-%loop-player%" to "&e&lTHE PIT"
  379.             set the text of id "PIT-%loop-player%Slot11" to "&7%now%"
  380.             set the text of id "PIT-%loop-player%Slot10" to "&1&e"
  381.             set the text of id "PIT-%loop-player%Slot9" to "&7Level &7[&e%{pit.%uuid of loop-player%.level}%&7]"
  382.             set the text of id "PIT-%loop-player%Slot8" to "&7Needed XP: &b%{_need}%"
  383.             set the text of id "PIT-%loop-player%Slot7" to "&2&9"
  384.             set the text of id "PIT-%loop-player%Slot6" to "&7Gold: &6&l%{pit.%uuid of loop-player%.gold}%"
  385.             set the text of id "PIT-%loop-player%Slot5" to "&3&9"
  386.             set the text of id "PIT-%loop-player%Slot4" to "&7Status: &5Event %"
  387.             set the text of id "PIT-%loop-player%Slot3" to "&7Made by: &aSukum_Decha"
  388.             set the text of id "PIT-%loop-player%Slot2" to "&4&9"
  389.             set the text of id "PIT-%loop-player%Slot1" to "%colored {THEPIT::SB::WEBSITE}%"
  390.    
  391.    
  392.    
  393. on damage of player:
  394.     if {pit.%uuid of victim%.state} is "ingame":
  395.         if damage cause is fall:
  396.             cancel event
  397.         if damage cause is void:
  398.             cancel event
  399.             kill victim
  400.         if "%damage cause%" is "projectile":
  401.             if {pit.%uuid of attacker%.perk::slot-1} or {pit.%uuid of attacker%.perk::slot-2} is "ENDLESS-QUIVER":
  402.                 give 3 arrows to attacker          
  403.         if attacker is player:
  404.             if attacker is not victim:
  405.                 wait 1 tick
  406.                 loop 20 times:
  407.                     set {_health.%loop-integer%.%victim%} to "&7❤"
  408.                     loop-integer is greater than max health of victim
  409.                     set {_health.%loop-integer%.%victim%} to ""
  410.                 loop rounded health of victim times:
  411.                     set {_health.%loop-integer%.%victim%} to "&4❤"
  412.                 set action bar of attacker to coloured "%{_health.1.%victim%}%%{_health.2.%victim%}%%{_health.3.%victim%}%%{_health.4.%victim%}%%{_health.5.%victim%}%%{_health.6.%victim%}%%{_health.7.%victim%}%%{_health.8.%victim%}%%{_health.9.%victim%}%%{_health.10.%victim%}%%{_health.11.%victim%}%%{_health.12.%victim%}%%{_health.13.%victim%}%%{_health.14.%victim%}%%{_health.15.%victim%}%%{_health.16.%victim%}%%{_health.17.%victim%}%%{_health.18.%victim%}%%{_health.19.%victim%}%%{_health.20.%victim%}%"
  413.                
  414.                 set {_sec.%uuid of victim%} to 10
  415.                 set {_sec.%uuid of attacker%} to 10
  416.                 if {pit.%uuid of victim%.status} is "&aIdling":
  417.                     set {pit.%uuid of victim%.status} to "&cFighting"
  418.                     while {pit.%uuid of victim%.status} is "&cFighting":
  419.                         remove 1 from {_sec.%uuid of victim%}
  420.                         wait 1 seconds
  421.                         if {_sec.%uuid of victim%} is 0:
  422.                             set {pit.%uuid of victim%.status} to "&aIdling"
  423.                            
  424.                 if {pit.%uuid of attacker%.status} is "&aIdling":
  425.                     set {pit.%uuid of attacker%.status} to "&cFighting"
  426.                     while {pit.%uuid of attacker%.status} is "&cFighting":
  427.                         remove 1 from {_sec.%uuid of attacker%}
  428.                         wait 1 seconds
  429.                         if {_sec.%uuid of attacker%} is 0:
  430.                             set {pit.%uuid of attacker%.status} to "&aIdling"
  431.                
  432.                 set {_dmg} to damage
  433.                 add rounded {_dmg} to {pit.%uuid of victim%.damage::%uuid of attacker%}
  434.                 if {pit.%uuid of victim%.damage::%uuid of attacker%}  > 10:
  435.                     set metadata value "ASSIST" of victim to attacker
  436.                     delete {pit.%uuid of victim%.damage::%uuid of attacker%}
  437.                    
  438.                     while {_sec.assist.%uuid of victim%} > 1:
  439.                         remove 1 from {_sec.assist.%uuid of victim%}
  440.                         wait 1 seconds
  441.                         {_sec.assist.%uuid of victim%} = 1:
  442.                             delete metadata value "ASSIST" of victim
  443.                        
  444.                    
  445.                    
  446.                    
  447.                        
  448.     else:
  449.         stop
  450.  
  451.  
  452.        
  453. function pit_give_gp(p: player):
  454.     set {_uuid} to uuid of {_p}
  455.     if {pit.%{_uuid}%.perk::slot-1} or {pit.%{_uuid}%.perk::slot-2} = "GOLDEN-HEADS":
  456.         if number of head in {_p}'s inventory = 0 or 1:
  457.             give skull of "StackedGold" parsed as offline player named "&6&lGolden Head" to {_p}
  458.     else:
  459.         if number of golden_apple in {_p}'s inventory = 0 or 1:
  460.             give 1 golden_apple to {_p}
  461.            
  462.        
  463. on death of player:
  464.     if {pit.%uuid of victim%.state} is "ingame":
  465.         set death message to ""
  466.         teleport victim to {pit.spawn}
  467.         clear drops
  468.         if metadata value "ASSIST" of victim is set:
  469.             set {_G} to metadata value "ASSIST" of victim
  470.             if {_G} is not attacker:
  471.                 set {_k} to {THEPIT::MESSAGES::ASSIST}
  472.                 set {_uuid} to uuid of {_G}
  473.                 replace all "[player]" in {_k} with "%victim%"
  474.                 replace all "[level]" in {_k} with "%{pit.%{_uuid}%.level}%"
  475.                 replace all "[gold]" in {_k} with "%{THEPIT::CONFIG::ASSIST-GOLD}%"
  476.                 replace all "[xp]" in {_k} with "%{THEPIT::CONFIG::ASSIST-XP}%"                
  477.                 add {THEPIT::CONFIG::ASSIST-GOLD} to {pit.%{_uuid}%.gold}
  478.                 add {THEPIT::CONFIG::ASSIST-XP} to {pit.%{_uuid}%.xp}              
  479.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_k}%" to {_G}        
  480.         add 1 to {pit.%uuid of attacker%.streak}
  481.         add {THEPIT::CONFIG::KILL-GOLD} to {pit.%uuid of attacker%.gold}
  482.         add {THEPIT::CONFIG::KILL-XP} to {pit.%uuid of attacker%.xp}
  483.         set {pit.%uuid of victim%.streak} to 0
  484.         if {pit.%uuid of attacker%.streak} = 5 or 10 or 15 or 25 or 30 or 35 or 40 or 45 or 50:
  485.             set {_x} to {THEPIT::MESSAGES::STREAK}
  486.             replace all "[streak]" in {_x} with "%{pit.%uuid of attacker%.streak}%"        
  487.             replace all "[level]" in {_x} with "%{pit.%uuid of attacker%.level}%"
  488.             replace all "[player]" in {_x} with "%attacker's displayname%"        
  489.             loop all players in attacker's world:
  490.                 if {pit.%uuid of loop-player%.state} is "ingame":
  491.                     send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to loop-player  
  492.         set {_x} to {THEPIT::MESSAGES::KILL}
  493.         replace all "[level]" in {_x} with "%{pit.%uuid of victim%.level}%"
  494.         replace all "[victim]" in {_x} with "%victim's displayname%"
  495.         replace all "[gold]" in {_x} with "%{THEPIT::CONFIG::KILL-GOLD}%"
  496.         replace all "[xp]" in {_x} with "%{THEPIT::CONFIG::KILL-XP}%"      
  497.         send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to attacker
  498.         bw_play_sound(attacker, {THEPIT::CONFIG::KILL-SOUND})
  499.         pit_give_gp(attacker)
  500.         pit_check_level(attacker)
  501.         send victim title "%colored {THEPIT::TITLES::DEATH-TITLE}%" with subtitle "%colored {THEPIT::TITLES::DEATH-SUBTITLE}%" for 1 seconds
  502.         wait 0.2 seconds
  503.         force victim to respawn
  504.         wait 0.2 seconds
  505.         teleport victim to {pit.spawn}
  506.         pit_updatetag(victim)
  507.         pit_equip(victim)      
  508.         set {pit.%uuid of victim%.status} to "&aIdling"
  509.         set action bar of attacker to coloured "&7&l%victim% &a&lKILL"
  510.     else:
  511.         stop
  512.    
  513. on right click with head:
  514.     if {pit.%uuid of player%.state} is "ingame":
  515.         if name of event-item is "&6&lGolden Head":
  516.             if {pit.%uuid of player%.perk::slot-1} or {pit.%uuid of player%.perk::slot-2} = "GOLDEN-HEADS":
  517.                 cancel event
  518.                 remove regeneration from player
  519.                 remove absorption from player
  520.                 apply regeneration 2 to the player for 5 seconds
  521.                 apply absorption 1 to the player for 120 seconds
  522.                 remove event-item from player
  523.             else:
  524.                 stop
  525.         else:
  526.             stop              
  527.     else:
  528.         stop
  529.  
  530. on right click on ender_chest:
  531.     if {pit.%uuid of player%.state} is "ingame":
  532.         if {pit.%uuid of player%.level} < {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}:
  533.             cancel event
  534.             set {_x} to {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG}
  535.             replace all "[level]" in {_x} with "%{THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}%"
  536.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%"
  537.  
  538. function pit_check_level(p: player):  
  539.     set {_uuid} to uuid of {_p}
  540.     if {pit.%{_uuid}%.xp} >= {pit.%{_uuid}%.xp-need}:
  541.         remove {pit.%{_uuid}%.xp-need} from {pit.%{_uuid}%.xp}
  542.         set {_old} to {pit.%{_uuid}%.level}
  543.         add 1 to {pit.%{_uuid}%.level}
  544.         pit_updatetag({_p})
  545.         set {_x} to {THEPIT::MESSAGES::LEVEL-UP}
  546.         replace all "[level]" with "%{pit.%{_uuid}%.level}%" in {_x}
  547.         send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
  548.         set {_x} to {THEPIT::TITLES::LEVEL-UP-TITLE}
  549.         set {_y} to {THEPIT::TITLES::LEVEL-UP-SUBTITLE}
  550.         replace all "[old]" with "%{_old}%" in {_x}
  551.         replace all "[old]" with "%{_old}%" in {_y}    
  552.         replace all "[new]" with "%{pit.%{_uuid}%.level}%" in {_x}
  553.         replace all "[new]" with "%{pit.%{_uuid}%.level}%" in {_y}    
  554.         send {_p} title "%colored {_x}%" with subtitle "%colored {_y}%" for 3 seconds
  555.         bw_play_sound({_p}, {THEPIT::CONFIG::LEVE-UP-SOUND})
  556.         set {_p}'s level to {pit.%{_uuid}%.level}
  557.         if {pit.%{_uuid}%.level} > 1:
  558.             set {pit.%{_uuid}%.xp-need} to 100*{pit.%{_uuid}%.level}
  559.             stop
  560.         else:
  561.             add 100 to {pit.%{_uuid}%.xp-need}
  562.             stop
  563.  
  564. function bw_play_sound(p: player, sound: text):
  565.     play sound "%{_sound}%" to {_p} with volume 100 and pitch 100
  566.    
  567. function pit_perk_shop(p: player, slot: integer):  
  568.     set {_uuid} to uuid of {_p}
  569.     open virtual chest inventory with size 3 named "Chose a Perk" to {_p}
  570.     make a gui slot 10 of {_p} with gold block named "&cGolden Heads" with lore "||&7Golden apples you earn turn into &6Golden Heads||||&8&l- &7COST: &6&l500||" to run:  
  571.         if {pit.%{_uuid}%.perk::golden-heads} is not set:
  572.             if {pit.%{_uuid}%.gold} >= 500:
  573.                 set {pit.%{_uuid}%.perk::golden-heads} to true
  574.                 set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
  575.                 remove 500 from {pit.%{_uuid}%.gold}
  576.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
  577.                 pit_upgrades_shop({_p})
  578.                 stop
  579.             else:
  580.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"  
  581.                 stop  
  582.         else:
  583.             set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
  584.             pit_upgrades_shop({_p})
  585.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
  586.             stop
  587.     make a gui slot 12 of {_p} with fishing rod named "&cFishing rod" with lore "||&7Spawn with a fishing rod||||&8&l- &7COST: &6&l1000||" to run:
  588.         if {pit.%{_uuid}%.perk::fishing-rod} is not set:
  589.             if {pit.%{_uuid}%.gold} >= 1000:  
  590.                 set {pit.%{_uuid}%.perk::fishing-rod} to true
  591.                 set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
  592.                 remove 1000 from {pit.%{_uuid}%.gold}
  593.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
  594.                 pit_upgrades_shop({_p})
  595.                 stop
  596.             else:
  597.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"  
  598.                 stop  
  599.         else:
  600.             set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
  601.             pit_upgrades_shop({_p})
  602.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
  603.             stop  
  604.     make a gui slot 14 of {_p} with lava bucket named "&cLava Bucket" with lore "||&7Spawn with a lava bucket||||&8&l- &7COST: &6&l1000||" to run:
  605.         if {pit.%{_uuid}%.perk::lava-bucket} is not set:
  606.             if {pit.%{_uuid}%.gold} >= 1000:  
  607.                 set {pit.%{_uuid}%.perk::lava-bucket} to true
  608.                 set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "LAVA-BUCKET"
  609.                 remove 1000 from {pit.%{_uuid}%.gold}
  610.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
  611.                 pit_upgrades_shop({_p})
  612.                 stop
  613.             else:
  614.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"  
  615.                 stop  
  616.         else:
  617.             set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "LAVA-BUCKET"
  618.             pit_upgrades_shop({_p})
  619.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
  620.             stop
  621.     make a gui slot 16 of {_p} with bow named "&cEndless Quiver" with lore "||&7Get 3 arrows on arrow hit||||&8&l- &7COST: &6&l2000||" to run:
  622.         if {pit.%{_uuid}%.perk::endless-quiver} is not set:
  623.             if {pit.%{_uuid}%.gold} >= 2000:  
  624.                 set {pit.%{_uuid}%.perk::endless-quiver} to true
  625.                 set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
  626.                 remove 2000 from {pit.%{_uuid}%.gold}
  627.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
  628.                 pit_upgrades_shop({_p})
  629.                 stop
  630.             else:
  631.                 send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"  
  632.                 stop  
  633.         else:
  634.             set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
  635.             pit_upgrades_shop({_p})
  636.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
  637.             stop          
  638.  
  639.  
  640. function pit_upgrades_shop(p: player):
  641.     set {_uuid} to uuid of {_p}
  642.     open virtual chest inventory with size 5 named "Permanent upgrades" to {_p}
  643.     wait 1 ticks  
  644.     if {pit.%{_uuid}%.perk::slot-1} is not set:
  645.         make a gui slot 12 of {_p} with diamond block named "&aPERK SLOT ##1" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 1)
  646.     if {pit.%{_uuid}%.perk::slot-2} is not set:
  647.         make a gui slot 14 of {_p} with diamond block named "&aPERK SLOT ##2" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 2)  
  648.        
  649.     if {pit.%{_uuid}%.perk::slot-1} is set:
  650.         if {pit.%{_uuid}%.perk::slot-1} = "GOLDEN-HEADS":
  651.             make a gui slot 12 of {_p} with gold block named "&ePERK SLOT &3##1 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 1)
  652.         if {pit.%{_uuid}%.perk::slot-1} = "FISHING-ROD":      
  653.             make a gui slot 12 of {_p} with fishing rod named "&ePERK SLOT &3##1 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 1)
  654.         if {pit.%{_uuid}%.perk::slot-1} = "LAVA-BUCKET":      
  655.             make a gui slot 12 of {_p} with lava bucket named "&ePERK SLOT &3##1 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 1)  
  656.         if {pit.%{_uuid}%.perk::slot-1} = "ENDLESS-QUIVER":    
  657.             make a gui slot 12 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 1)
  658.            
  659.     if {pit.%{_uuid}%.perk::slot-2} is set:        
  660.         if {pit.%{_uuid}%.perk::slot-2} = "GOLDEN-HEADS":
  661.             make a gui slot 14 of {_p} with gold block named "&ePERK SLOT &3##2 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 2)
  662.         if {pit.%{_uuid}%.perk::slot-2} = "FISHING-ROD":      
  663.             make a gui slot 14 of {_p} with fishing rod named "&ePERK SLOT &3##2 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 2)
  664.         if {pit.%{_uuid}%.perk::slot-2} = "LAVA-BUCKET":      
  665.             make a gui slot 14 of {_p} with lava bucket named "&ePERK SLOT &3##2 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 2)      
  666.         if {pit.%{_uuid}%.perk::slot-2} = "ENDLESS-QUIVER":    
  667.             make a gui slot 14 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 2)        
  668.                
  669.        
  670.  
  671.        
  672. function pit_items_shop(p: player):
  673.     open virtual chest inventory with size 3 named "Non-permanent items" to {_p}
  674.     wait 1 ticks
  675.     make a gui slot 10 of {_p} with diamond_sword named "&e&lDIAMOND SWORD" with lore "||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l100" to run:
  676.         set {_uuid} to uuid of {_p}
  677.         if {pit.%{_uuid}%.gold} >= 100:
  678.             remove 100 from {pit.%{_uuid}%.gold}
  679.             give 1 diamond_sword to {_p}
  680.             set {_item} to "DIAMOND SWORD"
  681.             set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
  682.             replace all "[item]" with "%{_item}%" in {_x}
  683.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
  684.         else:
  685.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
  686.     make a gui slot 11 of {_p} with 8 obsidian named "&e&lOBSIDIAN" with lore "||&8&l- &7REMAINS FOR 120 SECONDS||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l40" to run:
  687.         set {_uuid} to uuid of {_p}
  688.         if {pit.%{_uuid}%.gold} >= 40:
  689.             remove 100 from {pit.%{_uuid}%.gold}
  690.             give 8 obsidian to {_p}
  691.             set {_item} to "OBSIDIAN"
  692.             set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
  693.             replace all "[item]" with "%{_item}%" in {_x}          
  694.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
  695.         else:
  696.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"      
  697.  
  698.     make a gui slot 15 of {_p} with diamond_chestplate named "&e&lDIAMOND CHESTPLATE" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l250" to run:
  699.         set {_uuid} to uuid of {_p}
  700.         if {pit.%{_uuid}%.gold} >= 250:
  701.             remove 100 from {pit.%{_uuid}%.gold}
  702.             set {_p}'s chestplate to diamond_chestplate
  703.             set {_item} to "DIAMOND CHESTPLATE"
  704.             set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
  705.             replace all "[item]" with "%{_item}%" in {_x}          
  706.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
  707.         else:
  708.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"      
  709.  
  710.     make a gui slot 16 of {_p} with diamond_boots named "&e&lDIAMOND BOOTS" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l150" to run:
  711.         set {_uuid} to uuid of {_p}
  712.         if {pit.%{_uuid}%.gold} >= 150:
  713.             remove 100 from {pit.%{_uuid}%.gold}
  714.             set {_p}'s boots to diamond_boots
  715.             set {_item} to "DIAMOND BOOTS"
  716.             set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
  717.             replace all "[item]" with "%{_item}%" in {_x}          
  718.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
  719.         else:
  720.             send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"          
  721.  
  722.  
  723.  
  724. on plaece:
  725.     if {pit.%uuid of player%.state} is "ingame":
  726.         if event-block is obsidian:
  727.             wait 120 seconds
  728.             set event-block to air
  729.         if event-block is lava:
  730.             wait 2 seconds
  731.             set event-block to air
  732.         else:
  733.             cancel event
  734.     else:
  735.         stop
  736.        
  737. on block flow:
  738.     if event-block is lava:
  739.         loop {THEPIT::CONFIG::ENABLED-WORLDS::*}:
  740.             if event-world is loop-value:
  741.                 cancel event
  742. on breeak:
  743.     if {pit.%uuid of player%.state} is "ingame":
  744.         cancel event
  745.     else:
  746.         stop
  747.  
  748. on drop:
  749.     if {pit.%uuid of player%.state} is "ingame":
  750.         cancel event
  751.     else:
  752.         stop
  753.  
  754. on hunger bar change:
  755.     if {pit.%uuid of player%.state} is "ingame":
  756.         cancel event      
  757.         set player's hunger to 20
  758.        
  759.        
  760. on right click on entity:
  761.     if {pit.%uuid of player%.state} is "ingame":
  762.         if citizen id of event-entity is {THEPIT::CONFIG::SHOP-ID}:
  763.             pit_items_shop(player)
  764.         if citizen id of event-entity is {THEPIT::CONFIG::UPGRADE-ID}:
  765.             pit_upgrades_shop(player)
  766.     else:
  767.         stop
  768.    
  769.        
  770. function pit_updatetag(p: player):
  771.     set {_uuid} to uuid of {_p}
  772.     make console execute command "nte player %{_p}% prefix &7[&e%{pit.%{_uuid}%.level}%&7] &7"
  773.    
  774. function pit_equip(p: player):
  775.     set {_uuid} to uuid of {_p}
  776.     set {_p}'s level to {pit.%{_uuid}%.level}
  777.     set slot 0 of {_p} to unbreakable iron_sword
  778.     set slot 1 of {_p} to unbreakable bow
  779.     if {pit.%{_uuid}%.perk::slot-1} or {pit.%{_uuid}%.perk::slot-2} = "FISHING-ROD":
  780.         set slot 2 of {_p} to unbreakable fishing rod
  781.     if {pit.%{_uuid}%.perk::slot-2} or {pit.%{_uuid}%.perk::slot-1} = "LAVA-BUCKET":
  782.         set slot 3 of {_p} to lava bucket      
  783.     set slot 8 of {_p} to 30 arrows
  784.     wait 0.5 seconds
  785.     set {_p}'s helmet to unbreakable chain_helmet
  786.     set {_p}'s chestplate to unbreakable chain_chestplate
  787.     set {_p}'s leggings to unbreakable iron_leggings
  788.     set {_p}'s boots to unbreakable iron_boots
  789.    
  790.    
  791. on join:
  792.     set join message to ""
  793.    
  794. on quit:
  795.     set quit message to ""
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