Zeldaboy111

Skript #127

Mar 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.03 KB | None | 0 0
  1. #Functies:
  2. # baanGui, baanCheckAdd
  3.  
  4. options:
  5. {mn::baan::%loop-player%::houthakker::level} = {mn::baan::%{_p}%::houthakker::level}
  6. {mn::baan::%loop-player%::miner::level} = {mn::baan::%{_p}%::miner::level}
  7. {mn::baan::%loop-player%::bouwer::level} = {mn::baan::%{_p}%::bouwer::level}
  8.  
  9. {mn::baan::%loop-player%::totlevel} = {mn::baan::%{_p}%::totlevel}
  10. {mn::baan::%loop-player%::totlevel} = {mn::baan::%player%::totlevel}
  11.  
  12. function baanGui(p: player, page: string):
  13. if {_page} is "1":
  14.  
  15. open chest with 6 rows named "&3&lBaan" to {_p}
  16.  
  17. if {mn::baan::%{_p}%::houthakker} is true:
  18. make gui slot 10 of {_p} with a wooden axe named "&2Houthakker" with lore "&aGekozen" to run function baanGui({_p}, "houthakker")
  19.  
  20. else:
  21. make a gui slot 10 of {_p} with a wooden axe named "&2Houthakker" with lore "&aUnlocked" to run function baanGui({_p}, "houthakker")
  22.  
  23. if {mn::baan::%{_p}%::miner} is true:
  24. make gui slot 12 of {_p} with a wooden pickaxe named "&2Miner" with lore "&aGekozen" to run function baanGui({_p}, "miner")
  25.  
  26. else:
  27. make a gui slot 12 of {_p} with a wooden pickaxe named "&2Miner" with lore "&aUnlocked" to run function baanGui({_p}, "miner")
  28.  
  29.  
  30.  
  31. if {mn::baan::%{_p}%::bouwer} is true:
  32. make gui slot 14 of {_p} with brick block named "&2Bouwer" with lore "&aGekozen" to run function baanGui({_p}, "bouwer")
  33.  
  34. else:
  35. make gui slot 14 of {_p} with brick block named "&2Bouwer" with lore "&aUnlocked" to run function baanGui({_p}, "bouwer")
  36.  
  37. if {mn::baan::%{_p}%::farmer} is true:
  38. make gui slot 16 of {_p} with a wooden hoe named "&2Farmer" with lore "&aGekozen" to run function baanGui({_p}, "farmer")
  39.  
  40. else:
  41. make gui slot 16 of {_p} with a wooden hoe named "&2Farmer" with lore "&aUnlocked" to run function baanGui({_p}, "farmer")
  42.  
  43. if {mn::baan::%{_p}%::soldaat} is true:
  44. make gui slot 28 of {_p} with a iron sword named "&2Soldaat" with lore "&aGekozen" to run function baanGui({_p}, "soldaat")
  45.  
  46. else:
  47. make gui slot 28 of {_p} with a iron sword named "&2Soldaat" with lore "&aUnlocked" to run function baanGui({_p}, "soldaat")
  48.  
  49. if {mn::baan::%{_p}%::smid} is true:
  50. make gui slot 30 of {_p} with an anvil named "&2Smid" with lore "&aGekozen" to run function baanGui({_p}, "smid")
  51.  
  52. else:
  53. make gui slot 30 of {_p} with an anvil named "&2Smid" with lore "&aUnlocked" to run function baanGui({_p}, "smid")
  54.  
  55. if {mn::baan::%{_p}%::enchanter} is true:
  56. make gui slot 32 of {_p} with an enchantment table named "&2Enchanter" with lore "&aGekozen" to run function baanGui({_p}, "enchanter")
  57.  
  58. else:
  59. if {mn::baan::%{_p}%::totlevel} is more than 40:
  60. make gui slot 14 of {_p} with a compass named "&2Enchanter" with lore "&aUnlocked" to run function baanGui({_p}, "enchanter")
  61. else:
  62. format slot 32 of {_p} with an enchantment table named "&4Enchanter" with lore "&4Locked" to be unstealable
  63.  
  64. if {mn::baan::%{_p}%::ontdekkingsreiziger} is true:
  65. make gui slot 34 of {_p} with a compass named "&2Ontdekkingsreiziger" with lore "&aGekozen" to run function baanGui({_p}, "ontdekkingsreiziger")
  66.  
  67. else:
  68. if {mn::baan::%{_p}%::totlevel} is more than 60:
  69. make gui slot 14 of {_p} with a compass named "&2Ontdekkingsreiziger" with lore "&aUnlocked" to run function baanGui({_p}, "ontdekkingsreiziger")
  70. else:
  71. format slot 34 of {_p} with a compass named "&4Ontdekkingsreiziger" with lore "&4Locked" to be unstealable
  72.  
  73.  
  74. format slot 49 of {_p} with a barrier named "&4Sluit het menu" to close
  75.  
  76.  
  77. if {_page} is "houthakker":
  78. open chest with 5 rows named "&3Houthakker" to {_p}
  79.  
  80. if {mn::baan::%{_p}%::houthakker} is true:
  81. make gui slot 13 of {_p} with a wooden axe named "&2Houthakker" with lore "&aGekozen" to run function baanCheckAdd({_p}, "houthakker")
  82. else:
  83. wait 3 ticks
  84. make gui slot 13 of {_p} with a wooden axe named "&2Houthakker" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "houthakker")
  85.  
  86. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::houthakker::level}%" to be unstealable
  87.  
  88.  
  89. if {_page} is "miner":
  90. open chest with 5 rows named "&3Miner" to {_p}
  91.  
  92. if {mn::baan::%{_p}%::miner} is true:
  93. format slot 13 of {_p} with a wooden pickaxe named "&2Miner" with lore "&aGekozen" to be unstealable
  94. else:
  95. wait 3 ticks
  96. make gui slot 13 of {_p} with a wooden pickaxe named "&2Miner" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "miner")
  97.  
  98. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::miner::level}%" to be unstealable
  99.  
  100. if {_page} is "bouwer":
  101. open chest with 5 rows named "&3Bouwer" to {_p}
  102.  
  103. if {mn::baan::%{_p}%::bouwer} is true:
  104. format slot 13 of {_p} with a brick block named "&2Bouwer" with lore "&aGekozen" to be unstealable
  105. else:
  106. wait 3 ticks
  107. make gui slot 13 of {_p} with a brick block named "&2Bouwer" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "bouwer")
  108.  
  109. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::bouwer::level}%" to be unstealable
  110.  
  111. if {_page} is "farmer":
  112. open chest with 5 rows named "&3Farmer" to {_p}
  113.  
  114. if {mn::baan::%{_p}%::farmer} is true:
  115. format slot 13 of {_p} with a wooden hoe named "&2Farmer" with lore "&aGekozen" to be unstealable
  116. else:
  117. wait 3 ticks
  118. make gui slot 13 of {_p} with a wooden hoe named "&2Farmer" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "farmer")
  119.  
  120. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::farmer::level}%" to be unstealable
  121.  
  122. if {_page} is "soldaat":
  123. open chest with 5 rows named "&3Soldaat" to {_p}
  124.  
  125. if {mn::baan::%{_p}%::soldaat} is true:
  126. format slot 13 of {_p} with a iron sword named "&2Soldaat" with lore "&aGekozen" to be unstealable
  127. else:
  128. wait 3 ticks
  129. make gui slot 13 of {_p} with a iron sword named "&2Soldaat" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "soldaat")
  130.  
  131. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::soldaat::level}%" to be unstealable
  132.  
  133. if {_page} is "smid":
  134. open chest with 5 rows named "&3Smid" to {_p}
  135.  
  136. if {mn::baan::%{_p}%::smid} is true:
  137. format slot 13 of {_p} with a anvil named "&2Smid" with lore "&aGekozen" to be unstealable
  138. else:
  139. wait 3 ticks
  140. make gui slot 13 of {_p} with a anvil named "&2Smid" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "smid")
  141.  
  142. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::smid::level}%" to be unstealable
  143.  
  144. if {_page} is "enchanter":
  145. open chest with 5 rows named "&3Enchanter" to {_p}
  146.  
  147. if {mn::baan::%{_p}%::enchanter} is true:
  148. format slot 13 of {_p} with a enchantment table named "&2Enchanter" with lore "&aGekozen" to be unstealable
  149. else:
  150. wait 3 ticks
  151. if {mn::baan::%{_p}%::totlevel} is more than 40:
  152. make gui slot 14 of {_p} with a compass named "&2Enchanter" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "enchanter")
  153.  
  154. else:
  155. format slot 13 of {_p} with a enchantment table named "&4Enchanter" with lore "&4Locked" to be unstealable
  156.  
  157. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::enchanter::level}%" to be unstealable
  158.  
  159. if {_page} is "ontdekkingsreiziger":
  160. open chest with 5 rows named "&3Ontdekkingsreiziger" to {_p}
  161.  
  162. if {mn::baan::%{_p}%::ontdekkingsreiziger} is true:
  163. format slot 13 of {_p} with a compass named "&2Ontdekkingsreiziger" with lore "&aGekozen" to be unstealable
  164. else:
  165. wait 3 ticks
  166. if {mn::baan::%{_p}%::totlevel} is more than 60:
  167. make gui slot 14 of {_p} with a compass named "&2Ontdekkingsreiziger" with lore "&aUnlocked" to run function baanCheckAdd({_p}, "ontdekkingsreiziger")
  168. else:
  169. format slot 13 of {_p} with a compass named "&4Ontdekkingsreiziger" with lore "&4Locked" to be unstealable
  170.  
  171. format slot 28 of {_p} with a exp bottle named "&2Level:" with lore "&a%{mn::baan::%{_p}%::ontdekkingsreiziger::level}%" to be unstealable
  172.  
  173.  
  174.  
  175. every 1 tick:
  176. loop all players:
  177. if {mn::baan::%loop-player%::houthakker::level} is not set:
  178. set {mn::baan::%loop-player%::houthakker::level} to 0
  179.  
  180. if {mn::baan::%loop-player%::miner::level} is not set:
  181. set {mn::baan::%loop-player%::miner::level} to 0
  182.  
  183. if {mn::baan::%loop-player%::bouwer::level} is not set:
  184. set {mn::baan::%loop-player%::bouwer::level} to 0
  185.  
  186. if {mn::baan::%loop-player%::farmer::level} is not set:
  187. set {mn::baan::%loop-player%::farmer::level} to 0
  188.  
  189. if {mn::baan::%loop-player%::soldaat::level} is not set:
  190. set {mn::baan::%loop-player%::soldaat::level} to 0
  191.  
  192. if {mn::baan::%loop-player%::smid::level} is not set:
  193. set {mn::baan::%loop-player%::smid::level} to 0
  194.  
  195. if {mn::baan::%loop-player%::enchanter::level} is not set:
  196. set {mn::baan::%loop-player%::enchanter::level} to 0
  197.  
  198. if {mn::baan::%loop-player%::ontdekkingsreiziger::level} is not set:
  199. set {mn::baan::%loop-player%::ontdekkingsreiziger::level} to 0
  200.  
  201. delete {mn::baan::%loop-player%::totlevel}
  202. set {mn::baan::%loop-player%::totlevel} to "%{mn::baan::%loop-player%::houthakker::level} + {mn::baan::%loop-player%::miner::level} + {mn::baan::%loop-player%::bouwer::level} + {mn::baan::%loop-player%::farmer::level} + {mn::baan::%loop-player%::soldaat::level} + {mn::baan::%loop-player%::smid::level} + {mn::baan::%loop-player%::enchanter::level} + {mn::baan::%loop-player%::ontdekkingsreiziger::level}%"
  203. #send "%{mn::baan::%loop-player%::houthakker::level}% %{mn::baan::%loop-player%::miner::level}% %{mn::baan::%loop-player%::bouwer::level}% %{mn::baan::%loop-player%::farmer::level}% %{mn::baan::%loop-player%::soldaat::level}% %{mn::baan::%loop-player%::smid::level}% %{mn::baan::%loop-player%::enchanter::level}% %{mn::baan::%loop-player%::ontdekkingsreiziger::level}%" to console
  204.  
  205. function baanCheckAdd(p: player, baan: string):
  206. if {mn::baan::maxbanen::%{_p}%} is not set:
  207. set {mn::baan::maxbanen::%{_p}%} to 1
  208.  
  209.  
  210.  
  211. if {mn::baan::banen::%{_p}%} is not set:
  212. set {mn::baan::banen::%{_p}%} to 0
  213.  
  214. #delete {mn::baan::banen::%{_p}%}
  215. #delete {mn::baan::%{_p}%::%{_baan}%}
  216.  
  217. if {mn::baan::maxbanen::%{_p}%} != {mn::baan::banen::%{_p}%}:
  218.  
  219. set {mn::baan::%{_p}%::%{_baan}%} to true
  220. add 1 to {mn::baan::banen::%{_p}%}
  221. set {mn::baan::%{_p}%::%{_baan}%::level} to 1
  222.  
  223. baanMessage({_p}, "mn.succes", "&rSuccesvol de baan: &f%{_baan}% &rgekozen.")
  224.  
  225. else:
  226. baanMessage({_p}, "mn.maxb", "&rJe hebt al het maximaal aantal banen dat je kan hebben.")
  227.  
  228. function baanMessage(p: player, type: string, message: string):
  229. if {_type} contains "mn.":
  230. set {_prefix} to "&0[&b&lMineNation&0]&6"
  231. replace all "mn." in {_type} with ""
  232.  
  233. send "%{_type}%" to console
  234. if {_type} is "maxb":
  235. replace all "&r" in {_message} with "&4"
  236.  
  237. if {_type} is "succes":
  238. replace all "&r" in {_message} with "&2"
  239.  
  240.  
  241. send "%{_prefix}% %{_message}%" to {_p}
  242.  
  243.  
  244. command /test:
  245. trigger:
  246. baanMessage(player, "mn.succes", "Je hebt al het maximaal aantal banen dat je kan hebben.")
  247. send "%{mn::baan::%player%::totlevel}%"
Advertisement
Add Comment
Please, Sign In to add comment