Advertisement
AdamLam

Untitled

Jan 31st, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.66 KB | None | 0 0
  1. function SecToMin(s: number):
  2. set {_s0} to mod({_s}, 60)
  3. set {_s1} to {_s}-{_s0}
  4. set {_s2} to {_s1}/60
  5. exit
  6. on script load:
  7. send "&7[&6IslePvPbuildings&7] loaded &asuccessfuly." to console
  8. on first join:
  9. set {buildTime.%player%} to true
  10. command /ipb [<text>] [<text>]:
  11. permission: ipb.admin
  12. trigger:
  13. if arg 1 is "farm1":
  14. give a paper named "&eFarm I &aSchematic" with lore "||&6>> &7Click on &eYellow &7wool to build a farm||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  15. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aFarm Schematic&c!"
  16. stop
  17. if arg 1 is "mine1":
  18. give a paper named "&8Mine I &aSchematic" with lore "||&6>> &7Click on &8Gray &7wool to build a mine||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  19. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aMine Schematic&c!"
  20. stop
  21. if arg 1 is "house1":
  22. give a paper named "&fHouse I &aSchematic" with lore "||&6>> &7Click on &fWhite &7wool to build a house and upgrade island||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  23. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aHouse Schematic&c!"
  24. stop
  25. if arg 1 is "lumber1":
  26. give a paper named "&6Lumber Mill I &aSchematic" with lore "||&6>> &7Click on &6Brown &7wool to build a lumber mill||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  27. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aLumber Mill Schematic&c!"
  28. stop
  29. if arg 1 is "docks1":
  30. give a paper named "&3Docks I &aSchematic" with lore "||&6>> &7Click on &3Cyan &7wool to build a docks and unlock &bShip||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  31. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aDocks Schematic&c!"
  32. stop
  33. if arg 1 is "forge1":
  34. give a paper named "&7Forge I &aSchematic" with lore "||&6>> &7Click on &7&lLight Gray &7wool to build a forge||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250" to player
  35. send "&7[&6IslePvPbuildings&7] &6>> &cYou received &aForge Schematic&c!"
  36. stop
  37. if arg 1 is "list":
  38. send ""
  39. send "&c&l>>>>>>>>>> &7[&6IslePvPbuildings&7] &c&l<<<<<<<<<<"
  40. send "&7/ipb ship1 - First level of Ship"
  41. send "&7/ipb farm1 - First level of Farm"
  42. send "&7/ipb mine1 - First level of Mine"
  43. send "&7/ipb house1 - First level of House"
  44. send "&7/ipb lumber1 - First level of Lumber"
  45. send "&7/ipb docks1 - First level of Docks"
  46. send "&7/ipb forge1 - First level of Forge"
  47. send "&7/ipb list - List of available buildings"
  48. send "&7admin: /ipb <true/false/chceck>"
  49. send "&7Author: &d&mi&f&lNe&8&lzu&6&lko"
  50. stop
  51. if arg 1 is not set:
  52. send ""
  53. send "&c&l>>>>>>>>>> &7[&6IslePvPbuildings&7] &c&l<<<<<<<<<<"
  54. send ""
  55. send "&7/ipb list- List of available commands."
  56. send ""
  57. send "&7Author: &d&mi&f&lNe&8&lzu&6&lko"
  58. stop
  59. if arg 1 is "true":
  60. if arg 2 is set:
  61. set {buildTime.%arg 2%} to true
  62. send "&7[&6IslePvPbuildings&7] &6>> &7%arg 2%'s &atrue!"
  63. else:
  64. send "&7[&6IslePvPbuildings&7] &6>> &7Arg 2 is empty!"
  65. if arg 1 is "false":
  66. if arg 2 is set:
  67. set {buildTime.%arg 2%} to false
  68. send "&7[&6IslePvPbuildings&7] &6>> &7%arg 2%'s &cfalse!"
  69. else:
  70. send "&7[&6IslePvPbuildings&7] &6>> &7Arg 2 is empty!"
  71. if arg 1 is "check":
  72. send "&7[&6IslePvPbuildings&7] &6>> &7 %arg 2% is %{buildTime.%arg 2%}% !"
  73. function woolBuild(player: player,name: text,loc: location,block: material,time: number):
  74. wait 20 ticks
  75. if {buildTime.%{_player}%} is false:
  76. if {buildTimeVip.%{_player}%} is true:
  77. set block at {_loc} to {_block}
  78. send "&7[&6IslePvPbuildings&7] &6>> &7Building &b%{_name}% &7started!" to {_player}
  79. set {buildTimeVip.%{_player}%} to false
  80. set {_time.%{_player}%.now} to convert date now to unix date
  81. set {_time.%{_player}%.start} to convert date now to unix date
  82. while difference between {_time.%{_player}%.start} and {_time.%{_player}%.now} is less than {_time}:
  83. set {_time.%{_player}%.now} to convert date now to unix date
  84. set {_%{_player}%.czasowaZmienna} to difference between {_time.%{_player}%.start} and {_time.%{_player}%.now}
  85. set {_czasVIP} to {_time} - {_%{_player}%.czasowaZmienna}
  86. set {_czasVIP0} to mod({_czasVIP},60)
  87. set {_czasVIP1} to {_czasVIP}-{_czasVIP0}
  88. set {_czasVIP2} to {_czasVIP1}/60
  89. set {_czasVIP2} to {_czasVIP2}+1 #Dla graczy, wizualnie lepiej wygląda zostało 1 min gdy zostało 50 sekund niż 0 min gdy zostało 50 sekund
  90. wait 10 ticks
  91. set block at {_loc} to {_block}
  92. set line 1 of block at {_loc} to "[%{_name}%]"
  93. set line 2 of block at {_loc} to "&8&lIn Construction"
  94. set line 3 of block at {_loc} to "&8&lTime Left:"
  95. set line 4 of block at {_loc} to "&c%{_czasVIP2}% min"
  96. set line 2 of block at {_loc} to ""
  97. set line 3 of block at {_loc} to "&2&lCompleted!"
  98. set line 4 of block at {_loc} to "&7Right Click"
  99. set {buildTimeVip.%{_player}%} to true
  100. exit
  101. else:
  102. exit
  103. else if {buildTime.%{_player}%} is true:
  104. set block at {_loc} to {_block}
  105. send "&7[&6IslePvPbuildings&7] &6>> &7Building &b%{_name}% &7started!" to {_player}
  106. set {buildTime.%{_player}%} to false
  107. set {_time.%{_player}%.now} to convert date now to unix date
  108. set {_time.%{_player}%.start} to convert date now to unix date
  109. while difference between {_time.%{_player}%.start} and {_time.%{_player}%.now} is less than {_time}:
  110. set {_time.%{_player}%.now} to convert date now to unix date
  111. set {_%{_player}%.czasowaZmienna} to difference between {_time.%{_player}%.start} and {_time.%{_player}%.now}
  112. set {_czas} to {_time} - {_%{_player}%.czasowaZmienna}
  113. set {_czas0} to mod({_czas},60)
  114. set {_czas1} to {_czas}-{_czas0}
  115. set {_czas2} to {_czas1}/60
  116. set {_czas2} to {_czas2}+1 #Dla graczy, wizualnie lepiej wygląda zostało 1 min gdy zostało 50 sekund niż 0 min gdy zostało 50 sekund
  117. wait 10 ticks
  118. set block at {_loc} to {_block}
  119. set line 1 of block at {_loc} to "[%{_name}%]"
  120. set line 2 of block at {_loc} to "&8&lIn Construction"
  121. set line 3 of block at {_loc} to "&8&lTime Left:"
  122. set line 4 of block at {_loc} to "&c%{_czas2}% min"
  123. set line 2 of block at {_loc} to ""
  124. set line 3 of block at {_loc} to "&2&lCompleted!"
  125. set line 4 of block at {_loc} to "&7Right Click"
  126. set {buildTime.%{_player}%} to true
  127. exit
  128. else if {buildTime.%{_player}%} is false:
  129. exit
  130. function woolCoast(player: player,block: location):
  131. drawDot count 2, particle "smoke", material wool, XYZ 0.5, 0.4, 0.5, center location of {_block}, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  132. play raw sound "note.bassattack" at {_player} with pitch 1 volume 1
  133. send "&7[&6IslePvPbuildings&7] &6>> &cYou dont have enough items yet!" to {_player}
  134. exit
  135. on rightclick on wool:
  136. if "%world of player%" is "islepvp":
  137. if block below event-block is anvil:
  138. if {buildTimeVip.%player%} is not set:
  139. set {buildTimeVip.%player%} to true
  140. if {buildTime.%player%} is not set:
  141. set {buildTime.%player%} to true
  142. if {buildTime.%player%} or {buildTimeVip.%player%} are true:
  143. if event-block is yellow wool:
  144. wait 2 ticks
  145. if player's held item is paper named "&eFarm I &aSchematic" with lore "||&6>> &7Click on &eYellow &7wool to build a farm||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  146. if block 2 below event-block is sea lantern:
  147. if player has 1 diamond:
  148. remove 1 diamond from player's inventory
  149. remove 1 of player's held item from player's inventory
  150. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  151. wait 10 ticks
  152. woolBuild(player,"Farm I",location of event-block,sign:9,180)
  153. stop
  154. else:
  155. woolCoast(player,event-block)
  156. stop
  157. else:
  158. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  159. else:
  160. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  161. play raw sound "note.hat" at player with pitch 1 volume 1
  162. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &eFarm &ahere!"
  163. if event-block is gray wool:
  164. if player's held item is paper named "&8Mine I &aSchematic" with lore "||&6>> &7Click on &8Gray &7wool to build a mine||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  165. if block 2 below event-block is sea lantern:
  166. if player has 1 diamond:
  167. remove 1 diamond from player's inventory
  168. remove 1 of player's held item from player's inventory
  169. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  170. wait 10 ticks
  171. woolBuild(player,"Mine I",location of event-block,sign:9,10)
  172. stop
  173. else:
  174. woolCoast(player,event-block)
  175. stop
  176. else:
  177. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  178. else:
  179. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  180. play raw sound "note.hat" at player with pitch 1 volume 1
  181. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &8Mine &ahere!"
  182. if event-block is white wool:
  183. if player's held item is paper named "&fHouse I &aSchematic" with lore "||&6>> &7Click on &fWhite &7wool to build a house and upgrade island||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  184. if block 2 below event-block is sea lantern:
  185. if player has 1 diamond:
  186. remove 1 diamond from player's inventory
  187. remove 1 of player's held item from player's inventory
  188. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  189. wait 10 ticks
  190. woolBuild(player,"House I",location of event-block,sign:9,10)
  191. stop
  192. else:
  193. woolCoast(player,event-block)
  194. stop
  195. else:
  196. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  197. else:
  198. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  199. play raw sound "note.hat" at player with pitch 1 volume 1
  200. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &fHouse &ahere!"
  201. if event-block is brown wool:
  202. if player's held item is paper named "&6Lumber Mill I &aSchematic" with lore "||&6>> &7Click on &6Brown &7wool to build a lumber mill||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  203. if block 2 below event-block is sea lantern:
  204. if player has 1 diamond:
  205. remove 1 diamond from player's inventory
  206. remove 1 of player's held item from player's inventory
  207. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  208. wait 10 ticks
  209. woolBuild(player,"Lumber Mill I",location of event-block,sign:9,10)
  210. stop
  211. else:
  212. woolCoast(player,event-block)
  213. stop
  214. else:
  215. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  216. else:
  217. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  218. play raw sound "note.hat" at player with pitch 1 volume 1
  219. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &6Lumber Mill &ahere!"
  220. if event-block is cyan wool:
  221. if player's held item is paper named "&3Docks I &aSchematic" with lore "||&6>> &7Click on &3Cyan &7wool to build a docks and unlock &bShip||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  222. if block 2 below event-block is sea lantern:
  223. if player has 1 diamond:
  224. remove 1 diamond from player's inventory
  225. remove 1 of player's held item from player's inventory
  226. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  227. wait 10 ticks
  228. woolBuild(player,"Docks I",location of event-block,sign:9,10)
  229. stop
  230. else:
  231. woolCoast(player,event-block)
  232. stop
  233. else:
  234. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  235. else:
  236. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  237. play raw sound "note.hat" at player with pitch 1 volume 1
  238. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &3Docks &ahere!"
  239. if event-block is light gray wool:
  240. if player's held item is paper named "&7Forge I &aSchematic" with lore "||&6>> &7Click on &7&lLight Gray &7wool to build a forge||||&6>> &7Requirements:||&6>> &7Wood: &a500||&6>> &7Stone: &a250||&6>> &7Clay Block: &a250":
  241. if block 2 below event-block is sea lantern:
  242. if player has 1 diamond:
  243. remove 1 diamond from player's inventory
  244. remove 1 of player's held item from player's inventory
  245. play raw sound "random.anvil_use" at player with pitch 1 volume 1
  246. wait 10 ticks
  247. woolBuild(player,"Forge I",location of event-block,sign:9,10)
  248. stop
  249. else:
  250. woolCoast(player,event-block)
  251. stop
  252. else:
  253. send "&cError! Contact Administrator as soon as possible. Visit our Discord to do so!"
  254. else:
  255. drawDot count 2, particle "happyvillager", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  256. play raw sound "note.hat" at player with pitch 1 volume 1
  257. send "&7[&6IslePvPbuildings&7] &6>> &aYou can build &7Forge &ahere!"
  258. else:
  259. drawDot count 2, particle "smoke", material wool, XYZ 0.5, 0.4, 0.5, center location of event-block, visibleRange 10, pulseDelay 1, keepFor 1 seconds
  260. play raw sound "note.bassattack" at player with pitch 1 volume 1
  261. send "&7[&6IslePvPbuildings&7] &6>> &cYou can't have two constructions being built at the same time."
  262. function signBuild(player: player,loc: location,name: text,schematic: text):
  263. paste schematic "%{_schematic}%" at {_loc}
  264. wait 2 ticks
  265. send "&7[&6IslePvPbuildings&7] &7&l%{_name}% &7has been built!" to {_player}
  266. broadcast "&7[&6IslePvPbuildings&7] &a%{_player}% &7has just built &7&l%{_name}%"
  267. exit
  268. on rightclick on sign:
  269. if "%world of player%" is "islepvp":
  270. if line 2 is "&8&lIn Construction":
  271. play raw sound "note.bassattack" at player with pitch 1 volume 1
  272. send "&7[&6IslePvPbuildings&7] &cPlease wait... Structure is still building"
  273. else if line 3 is "&2&lCompleted!":
  274. set {loc} to location of block 1 up event-block
  275. drawDot count 15, particle "explosionlarge", XYZ 10, 20, 5, center location of block 3 up 15 south 10 east event-block, visibleRange 50, pulseDelay 3, keepFor 2 seconds
  276. play raw sound "random.anvil_land" at player with pitch 1 volume 1
  277. if line 1 is "[Farm I]":
  278. signBuild(player,{loc},"Farm I","farm1")
  279. else if line 1 is "[Mine I]":
  280. signBuild(player,{loc},"Mine I","mine1")
  281. else if line 1 is "[House I]":
  282. signBuild(player,{loc},"House I","house1")
  283. else if line 1 is "[Lumber Mill I]":
  284. signBuild(player,{loc},"Lumber Mill I","lumber1")
  285. else if line 1 is "[Docks I]":
  286. signBuild(player,{loc},"Docks I","docks1")
  287. else if line 1 is "[Forge I]":
  288. signBuild(player,{loc},"Forge I","forge1")
  289. set event-block to air
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement