Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.77 KB | None | 0 0
  1. #0.0.6
  2.  
  3.  
  4.  
  5. options:
  6.  
  7.  
  8. prefix: "&e&lTHE PIT -&7"
  9.  
  10.  
  11. #Settings
  12.  
  13. bungeecord: false
  14.  
  15. #Citizen Id.(found in /npc list)
  16.  
  17. shop-id: 0
  18.  
  19. upgrade-id: 1
  20.  
  21.  
  22. #Messages
  23.  
  24. chat: true
  25.  
  26. chatformat: "&7[&e%{pit.%uuid of player%.level}%&7] %colored player's prefix% %player% &8&l- &7%message% "
  27.  
  28.  
  29. kill-msg: "&a&lKILL! &7on [&e%{pit.%uuid of victim%.level}%&7] %victim's displayname% &b&l+15XP &6&l+10"
  30.  
  31. kill-streak-msg: "&c&lSTREAK! &7of &c%{pit.%uuid of attacker%.streak}% &7by [&e%{pit.%uuid of attacker%.level}%&7] %attacker's displayname%"
  32.  
  33. level-up: "&3&lLEVEL UP! &7[&e%{pit.%{_uuid}%.level}%&7]"
  34.  
  35. item-purchase: "&a&lPURCHASE! &6%{_item}%"
  36.  
  37. perk-purchase: "&a&lPURCHASED PERK!"
  38.  
  39. perk-selected: "&c&lSELECTED PERK"
  40.  
  41. no-gold: "&c&lNOT ENOUGHT GOLD!"
  42.  
  43. in-game: "&7You are in game. "
  44.  
  45. not-in-game: "&7You are not in game. "
  46.  
  47.  
  48. #Titles
  49.  
  50. level-up-title: "&b&lLEVEL UP!"
  51. level-up-subtitle: "&7[&e%{_old}%&7] &3&l-> &7[&e%{pit.%{_uuid}%.level}%&7]"
  52.  
  53. death-title: "&c&lYOU DIED"
  54. death-subtitle: "&e"
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. function pit_join(p: player):
  64. set {_uuid} to uuid of {_p}
  65. set {pit.%{_uuid}%.state} to "ingame"
  66. teleport {_p} to {pit.spawn}
  67. if {pit.%{_uuid}%.level} is not set:
  68. set {pit.%{_uuid}%.level} to 1
  69. if {pit.%{_uuid}%.xp} is not set:
  70. set {pit.%{_uuid}%.xp} to 0
  71. if {pit.%{_uuid}%.xp-need} is not set:
  72. set {pit.%{_uuid}%.xp-need} to 100
  73. if {pit.%{_uuid}%.gold} is not set:
  74. set {pit.%{_uuid}%.gold} to 0
  75. set {pit.%{_uuid}%.streak} to 0
  76. set {pit.%{_uuid}%.status} to "&aIdling"
  77. pit_updatetag( {_p})
  78. pit_equip( {_p})
  79.  
  80. function pit_leave(p: player):
  81. set {_uuid} to uuid of {_p}
  82. clear {_p}'s inventory
  83. delete stylish scoreboard "PIT-%{_p}%"
  84. delete {pit.%{_uuid}%.streak}
  85. delete {pit.%{_uuid}%.state}
  86. make console execute command "nte player %{_p}% clear"
  87. teleport {_p} to {pit.leave}
  88.  
  89. on join:
  90. if {@bungeecord} is true:
  91. pit_join(player)
  92. stop
  93. else:
  94. stop
  95.  
  96. command /pit [<text>]:
  97. trigger:
  98. if arg-1 is "join":
  99. if {pit.%uuid of player%.state} is not set:
  100. pit_join(player)
  101. stop
  102. else:
  103. send "{@prefix} {@in-game}"
  104. stop
  105. if arg-1 is "leave":
  106. if {@bungeecord} is false:
  107. if {pit.%uuid of player%.state} is "ingame":
  108. pit_leave(player)
  109. stop
  110. else:
  111. send "{@prefix} {@not-in-game}"
  112. stop
  113. else:
  114. stop
  115. if arg-1 is "setspawn":
  116. if player has permission "PIT.ADMIN":
  117. set {pit.spawn} to player's location
  118. send "{@prefix} &7Spawn Set"
  119. stop
  120. if arg-1 is "setleave":
  121. if player has permission "PIT.ADMIN":
  122. set {pit.leave} to player's location
  123. send "{@prefix} &7Leave point Set"
  124. stop
  125. else:
  126. send "{@prefix} &3&l> &7JOIN"
  127. send "{@prefix} &3&l> &7LEAVE"
  128. if player has permission "PIT.ADMIN":
  129. send "{@prefix} &3&l> &7SETSPAWN"
  130. send "{@prefix} &3&l> &7SETLEAVE"
  131. stop
  132. else:
  133. stop
  134.  
  135.  
  136.  
  137.  
  138.  
  139. on quit:
  140. pit_leave(player)
  141. stop
  142.  
  143.  
  144. on chat:
  145. if {pit.%uuid of player%.state} is "ingame":
  146. if {@chat} is true:
  147. cancel event
  148. broadcast "{@chatformat}"
  149. else:
  150. stop
  151. else:
  152. stop
  153.  
  154.  
  155.  
  156. on pressure plate:
  157. if {pit.%uuid of player%.state} is "ingame":
  158. cancel event
  159. push the player upwards at speed 0.4
  160. push the player forwards at speed 1.2
  161. else:
  162. stop
  163.  
  164.  
  165.  
  166.  
  167. every second:
  168. loop all players:
  169. if {pit.%uuid of loop-player%.state} is "ingame":
  170. if stylish scoreboard "PIT-%loop-player%" does not exist:
  171. create new stylish scoreboard named "PIT-%loop-player%"
  172. loop 10 times:
  173. 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%"
  174. set {_need} to {pit.%uuid of loop-player%.xp-need}-{pit.%uuid of loop-player%.xp}
  175. set stylish scoreboard of loop-player to "PIT-%loop-player%"
  176. set title of stylish scoreboard "PIT-%loop-player%" to "&e&lTHE PIT"
  177. set the text of id "PIT-%loop-player%Slot10" to "&7%now%"
  178. set the text of id "PIT-%loop-player%Slot9" to "&1&e"
  179. set the text of id "PIT-%loop-player%Slot8" to "&7Level &7[&e%{pit.%uuid of loop-player%.level}%&7]"
  180. set the text of id "PIT-%loop-player%Slot7" to "&7Needed XP: &b%{_need}%"
  181. set the text of id "PIT-%loop-player%Slot6" to "&2&9"
  182. set the text of id "PIT-%loop-player%Slot5" to "&7Gold: &6&l%{pit.%uuid of loop-player%.gold}%"
  183. set the text of id "PIT-%loop-player%Slot4" to "&3&9"
  184. set the text of id "PIT-%loop-player%Slot3" to "&7Status: %{pit.%uuid of loop-player%.status}%"
  185. set the text of id "PIT-%loop-player%Slot2" to "&4&9"
  186. set the text of id "PIT-%loop-player%Slot1" to "&eMC.SERVER.ORG"
  187.  
  188.  
  189.  
  190. on damage of player:
  191. if {pit.%uuid of victim%.state} is "ingame":
  192. if damage cause is fall:
  193. cancel event
  194. if damage cause is void:
  195. damage victim by 20
  196. if attacker is player:
  197. wait 1 tick
  198. loop 20 times:
  199. set {_health.%loop-integer%.%victim%} to "&7❤"
  200. loop-integer is greater than max health of victim
  201. set {_health.%loop-integer%.%victim%} to ""
  202. loop rounded health of victim times:
  203. set {_health.%loop-integer%.%victim%} to "&4❤"
  204. show an action bar from "%{_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%}%" to attacker
  205. set {pit.%uuid of victim%.status} to "&cFighting"
  206. set {pit.%uuid of attacker%.status} to "&cFighting"
  207.  
  208. else:
  209. stop
  210.  
  211.  
  212. function pit_give_gp(p: player):
  213. loop all items in {_p}'s inventory:
  214. if loop-item is golden_apple:
  215. stop
  216. set {_uuid} to uuid of {_p}
  217. if {pit.%{_uuid}%.perk::golden-heads} = true:
  218. give 1 golden_apple named "&6Golden Head" to {_p}
  219. else:
  220. give 1 golden_apple to {_p}
  221.  
  222. on death of player:
  223. if {pit.%uuid of victim%.state} is "ingame":
  224. set death message to ""
  225. teleport victim to {pit.spawn}
  226. clear drops
  227. add 1 to {pit.%uuid of attacker%.streak}
  228. add 10 to {pit.%uuid of attacker%.gold}
  229. add 15 to {pit.%uuid of attacker%.xp}
  230. set {pit.%uuid of victim%.streak} to 0
  231. if {pit.%uuid of attacker%.streak} = 5 or 10 or 15 or 25 or 30 or 35 or 40 or 45 or 50:
  232. loop all players in attacker's world:
  233. if {pit.%uuid of loop-player%.state} is "ingame":
  234. send"{@prefix} {@kill-streak-msg}" to loop-player
  235. send "{@prefix} {@kill-msg}" to attacker
  236. pit_give_gp(attacker)
  237. pit_check_level(attacker)
  238. send victim title "{@death-title}" with subtitle "{@death-subtitle}" for 1 seconds
  239. wait 1 seconds
  240. pit_equip(victim)
  241. pit_updatetag(victim)
  242. set {pit.%uuid of victim%.status} to "&aIdling"
  243. else:
  244. stop
  245.  
  246. on right click with golden apple:
  247. if {pit.%uuid of player%.state} is "ingame":
  248. if {pit.%uuid of player%.perk::slot-1} or {pit.%uuid of player%.perk::slot-2} = "GOLDEN-HEADS":
  249. remove regeneration from player
  250. remove absorption from player
  251. apply regeneration 2 to the player for 5 seconds
  252. apply absorption 1 to the player for 120 seconds
  253. remove 1 golden apple from player
  254. else:
  255. stop
  256. else:
  257. stop
  258.  
  259.  
  260. function pit_check_level(p: player):
  261. set {_uuid} to uuid of {_p}
  262. if {pit.%{_uuid}%.xp} >= {pit.%{_uuid}%.xp-need}:
  263. remove {pit.%{_uuid}%.xp-need} from {pit.%{_uuid}%.xp}
  264. set {_old} to {pit.%{_uuid}%.level}
  265. add 1 to {pit.%{_uuid}%.level}
  266. pit_updatetag({_p})
  267. send "{@prefix} {@level-up}" to {_p}
  268. send {_p} title "{@level-up-title}" with subtitle "{@level-up-subtitle}" for 3 seconds
  269. if {pit.%{_uuid}%.level} < 10:
  270. add 50 to {pit.%{_uuid}%.xp-need}
  271. stop
  272. if {pit.%{_uuid}%.level} < 20:
  273. add 70 to {pit.%{_uuid}%.xp-need}
  274. stop
  275. if {pit.%{_uuid}%.level} < 30:
  276. add 80 to {pit.%{_uuid}%.xp-need}
  277. stop
  278. if {pit.%{_uuid}%.level} < 50:
  279. add 100 to {pit.%{_uuid}%.xp-need}
  280. stop
  281. else:
  282. add 120 to {pit.%{_uuid}%.xp-need}
  283. stop
  284.  
  285.  
  286. function pit_perk_shop(p: player, slot: integer):
  287. set {_uuid} to uuid of {_p}
  288. open virtual chest inventory with size 3 named "Chose a Perk" to {_p}
  289. make a gui slot 12 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:
  290. if {pit.%{_uuid}%.perk::golden-heads} is not set:
  291. if {pit.%{_uuid}%.gold} >= 500:
  292. set {pit.%{_uuid}%.perk::golden-heads} to true
  293. set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
  294. remove 500 from {pit.%{_uuid}%.gold}
  295. send "{@prefix} {@perk-purchase}"
  296. pit_upgrades_shop({_p})
  297. stop
  298. else:
  299. send "{@prefix} {@no-gold}"
  300. stop
  301. else:
  302. set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
  303. pit_upgrades_shop({_p})
  304. send "{@prefix} {@perk-selected}"
  305. stop
  306. make a gui slot 14 of {_p} with fishing rod named "&cFishing rod" with lore "||&7Spawn with a fishing rod||||&8&l- &7COST: &6&l1000||" to run:
  307. if {pit.%{_uuid}%.perk::fishing-rod} is not set:
  308. if {pit.%{_uuid}%.gold} >= 1000:
  309. set {pit.%{_uuid}%.perk::fishing-rod} to true
  310. set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
  311. remove 1000 from {pit.%{_uuid}%.gold}
  312. send "{@prefix} {@perk-purchase}"
  313. pit_upgrades_shop({_p})
  314. stop
  315. else:
  316. send "{@prefix} {@no-gold}"
  317. stop
  318. else:
  319. set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
  320. pit_upgrades_shop({_p})
  321. send "{@prefix} {@perk-selected}"
  322. stop
  323.  
  324. command setgold:
  325. trigger:
  326. set {pit.%uuid of player%.gold} to 100000
  327.  
  328. function pit_upgrades_shop(p: player):
  329. set {_uuid} to uuid of {_p}
  330. open virtual chest inventory with size 5 named "Permanent upgrades" to {_p}
  331. wait 1 ticks
  332. if {pit.%{_uuid}%.perk::slot-1} is not set:
  333. 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)
  334. if {pit.%{_uuid}%.perk::slot-2} is not set:
  335. 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)
  336. if {pit.%{_uuid}%.perk::slot-1} is set:
  337. if {pit.%{_uuid}%.perk::slot-1} = "GOLDEN-HEADS":
  338. make a gui slot 12 of {_p} with gold block named "&ePERK SLOT &3##2 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 1)
  339. if {pit.%{_uuid}%.perk::slot-1} = "FISHING-ROD":
  340. make a gui slot 12 of {_p} with fishing rod named "&ePERK SLOT &3##2 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 1)
  341. if {pit.%{_uuid}%.perk::slot-2} is set:
  342. if {pit.%{_uuid}%.perk::slot-2} = "GOLDEN-HEADS":
  343. 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)
  344. if {pit.%{_uuid}%.perk::slot-2} = "FISHING-ROD":
  345. 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)
  346.  
  347.  
  348.  
  349.  
  350. function pit_items_shop(p: player):
  351. open virtual chest inventory with size 3 named "Non-permanent items" to {_p}
  352. wait 1 ticks
  353. 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:
  354. set {_uuid} to uuid of {_p}
  355. if {pit.%{_uuid}%.gold} >= 100:
  356. remove 100 from {pit.%{_uuid}%.gold}
  357. give 1 diamond_sword to {_p}
  358. set {_item} to "DIAMOND SWORD"
  359. send "{@prefix} {@item-purchase}" to {_p}
  360. else:
  361. send "{@prefix} {@no-gold}"
  362. 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:
  363. set {_uuid} to uuid of {_p}
  364. if {pit.%{_uuid}%.gold} >= 40:
  365. remove 100 from {pit.%{_uuid}%.gold}
  366. give 8 obsidian to {_p}
  367. set {_item} to "OBSIDIAN"
  368. send "{@prefix} {@item-purchase}" to {_p}
  369. else:
  370. send "{@prefix} {@no-gold}"
  371.  
  372. 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:
  373. set {_uuid} to uuid of {_p}
  374. if {pit.%{_uuid}%.gold} >= 250:
  375. remove 100 from {pit.%{_uuid}%.gold}
  376. set {_p}'s chestplate to diamond_chestplate
  377. set {_item} to "DIAMOND CHESTPLATE"
  378. send "{@prefix} {@item-purchase}" to {_p}
  379. else:
  380. send "{@prefix} {@no-gold}"
  381.  
  382. 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:
  383. set {_uuid} to uuid of {_p}
  384. if {pit.%{_uuid}%.gold} >= 150:
  385. remove 100 from {pit.%{_uuid}%.gold}
  386. set {_p}'s boots to diamond_boots
  387. set {_item} to "DIAMOND BOOTS"
  388. send "{@prefix} {@item-purchase}" to {_p}
  389. else:
  390. send "{@prefix} {@no-gold}"
  391.  
  392.  
  393.  
  394. on place:
  395. if {pit.%uuid of player%.state} is "ingame":
  396. if event-block is not obsidian:
  397. cancel event
  398. else:
  399. wait 120 seconds
  400. set event-block to air
  401. else:
  402. stop
  403.  
  404.  
  405. on break:
  406. if {pit.%uuid of player%.state} is "ingame":
  407. cancel event
  408. else:
  409. stop
  410.  
  411. on drop:
  412. if {pit.%uuid of player%.state} is "ingame":
  413. cancel event
  414. else:
  415. stop
  416.  
  417. on right click on entity:
  418. if {pit.%uuid of player%.state} is "ingame":
  419. if citizen id of event-entity is {@shop-id}:
  420. pit_items_shop(player)
  421. if citizen id of event-entity is {@upgrade-id}:
  422. pit_upgrades_shop(player)
  423. else:
  424. stop
  425.  
  426.  
  427. function pit_updatetag(p: player):
  428. set {_uuid} to uuid of {_p}
  429. make console execute command "nte player %{_p}% prefix &7[&e%{pit.%{_uuid}%.level}%&7] &7"
  430.  
  431. function pit_equip(p: player):
  432. set {_uuid} to uuid of {_p}
  433. set {_p}'s helmet to chain_helmet
  434. set {_p}'s chestplate to chain_chestplate
  435. set {_p}'s leggings to iron_leggings
  436. set {_p}'s boots to iron_boots
  437. set slot 0 of {_p} to iron_sword
  438. set slot 1 of {_p} to bow
  439. if {pit.%{_uuid}%.perk::slot-1} = "FISHING-ROD":
  440. set slot 2 of {_p} to fishing rod
  441. set slot 8 of {_p} to 30 arrows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement