Advertisement
Guest User

Untitled

a guest
Aug 15th, 2021
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. #=---------Skript by ItsKirby ver: 1.0----------=
  2. options:
  3. prefix: &b&lFTB &7|
  4. load: &b&lFTB &7| &fReloaded Find the button skript!
  5. timer: 5 #amount of minutes set for a timer
  6. #=---------Leave credits ty----------=
  7.  
  8. on join:
  9. joinitems(player)
  10. if {complete::%player's uuid%} is not set:
  11. set {complete::%player's uuid%} to 0
  12. if {failed::%player's uuid%} is not set:
  13. set {failed::%player's uuid%} to 0
  14.  
  15. on load:
  16. send "{@load}" to all players
  17.  
  18. command /ftb [<text>] [<text>] [<text>]:
  19. permission:*
  20. trigger:
  21. arg-1 is "game":
  22. arg-2 is "button":
  23. arg-3 is set:
  24. if {%arg-3%.game} is set:
  25. give 1 oak button named arg-3 to player
  26. send "{@prefix} &fGave you a button! Added button to button list!"
  27. if {%arg-3%.game} is not set:
  28. if arg-3 is not "list":
  29. send "{@prefix} &f%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f%arg-3%"
  30. if arg-3 is "list":
  31. send "{@prefix} &f%{Ftb.button::*}%"
  32. arg-2 is "delete":
  33. arg-3 is set:
  34. if {Ftb.button::*} contains arg-3:
  35. remove arg-3 from {Ftb.button::*}
  36. send "{@prefix} &fDeleted the game: &f%arg-3%"
  37. else:
  38. send "{@prefix} &f%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f%arg-3%"
  39. arg-2 is "create":
  40. arg-3 is set:
  41. if {%arg-3%.game} is not set:
  42. if arg-3 is not "list":
  43. add arg-3 to {Ftb.button::*}
  44. set {%arg-3%.game} to true
  45. send "{@prefix} &fCreated game: &7%arg-3%"
  46. else:
  47. send "{@prefix} &fCannot create this specific game! For skript purposes"
  48. else:
  49. send "{@prefix} &fGame has already been created!"
  50. arg-2 is "spawn":
  51. arg-3 is set:
  52. if {%arg-3%.game} is set:
  53. set {location::%arg-3%} to location of player
  54. send "{@prefix} &fSet your location for spawn for game: &7<%arg-3%>"
  55. else:
  56. send "{@prefix} &7%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f<%arg-3%>"
  57. arg-1 is not set:
  58. send "{@prefix} &fUsage for this command: &7/Ftb &f<game> <create <game>|spawn <game>|button <game|set>|remove <button> <game>"
  59.  
  60. on place:
  61. if event-item is oak button:
  62. if {Ftb.button::*} contains player's tool's name:
  63. add location of event-block to {Ftb.button.location::*}
  64. send "{@prefix} &fSet button location of &7%player's tool%"
  65.  
  66. on break:
  67. player has permission "*":
  68. if event-block is oak button:
  69. if {Ftb.button.location::*} contains event-block's location:
  70. remove location of event-block from {Ftb.button.location::*}
  71. send "{@prefix} &fRemoved button location!"
  72.  
  73. on right click:
  74. if event-block is oak button:
  75. if {playing::*} contains player's name:
  76. if {Ftb.button.location::*} contains event-block's location:
  77. complete(player)
  78.  
  79. command /joingame [<text>]:
  80. trigger:
  81. if {playing::*} doesn't contain player's name:
  82. if arg-1 is set:
  83. if {%arg-1%.game} is set:
  84. if {%arg-1%.game} is true:
  85. set {Ftb::spawn} to location of player
  86. add player's name to {playing::*}
  87. teleport player to {location::%arg-1%}
  88. wait 1 tick
  89. send title "&6&lGame: &f%arg-1%" with subtitle "&7Find the button!" to player for 2 seconds
  90. set {%player's uuid%.timer} to {@timer}
  91. else:
  92. send "{@prefix} &cThis game is in maintenace mode, come back later!"
  93. else:
  94. send "{@prefix} &fThis game doesn't exist! Do &7/gamelist &ffor games!"
  95. else:
  96. send "{@prefix} &fUsage of this command: &7/joingame &f<gamename>"
  97. else:
  98. send "{@prefix} &fCannot play another game while in running game!"
  99.  
  100. command /gamelist:
  101. trigger:
  102. send "{@prefix} &f%{Ftb.button::*}%"
  103.  
  104. every 1 minute:
  105. loop all players:
  106. if {%loop-player's uuid%.timer} is 0:
  107. lost(loop-player)
  108. delete {%loop-player's uuid%.timer}
  109. else:
  110. remove 1 from {%loop-player's uuid%.timer}
  111. send "{@prefix} &fYou have &6%{%loop-player's uuid%.timer}% &fminute left!" to loop-players
  112.  
  113. function lost(p: player):
  114. set {_u} to uuid of {_p}
  115. send title "&6&lYou took too long!" with subtitle "&7Try again!" to {_p} for 3 seconds
  116. add 1 to {failed::%{_u}%}
  117. wait 2 seconds
  118. clear {_p}'s inventory
  119. teleport {_p} to {Ftb::spawn}
  120. remove {_p}'s name from {playing::*}
  121.  
  122. function joinitems(p: player):
  123. set {_u} to uuid of {_p}
  124. clear {_p}'s inventory
  125. set slot 0 of {_p}'s inventory to paper named "&6Info" with lore "&7Right-click for help"
  126. set slot 8 of {_p}'s inventory to gold ingot named "&6Stats" with lore "&f%{_p}%&7's stats:" and "&fCompleted: &6%{complete::%{_u}%}%" and "&fFailed: &c%{failed::%{_u}%}%"
  127.  
  128. function complete(p: player):
  129. set {_u} to uuid of {_p}
  130. send title "&6&lYou completed the level!" with subtitle "&7Play another!" to {_p} for 3 seconds
  131. add 1 to {complete::%{_u}%}
  132. wait 3 seconds
  133. clear {_p}'s inventory
  134. teleport {_p} to {Ftb::spawn}
  135. remove {_p}'s name from {playing::*}
  136. joinitems({_p})
  137.  
  138. on right click:
  139. player's tool's name is "&6Info":
  140. player has permission "*":
  141. play sound "item.book.page_turn" for players
  142. send "{@prefix} &fThank you for using this skript!"
  143. wait 2.5 seconds
  144. play sound "item.book.page_turn" for players
  145. send "{@prefix} &fStart by creating a game! &7/Ftb game create Your_game_name"
  146. wait 3 seconds
  147. play sound "item.book.page_turn" for players
  148. send "{@prefix} &fSet the game's start location! &7/Ftb game spawn Your_game_name"
  149. wait 3 seconds
  150. play sound "item.book.page_turn" for players
  151. send "{@prefix} &fGive yourself the game button and place it in the game's map! &7/Ftb game button Your_game_name"
  152. wait 4 seconds
  153. play sound "item.book.page_turn" for players
  154. send "{@prefix} &fAnd you're done! Play a game by doing &7/Joingame Your_game_name &fand have a good time!"
  155. wait 3 seconds
  156. play sound "entity.player.levelup" for players
  157. player does not have permission "*":
  158. play sound "item.book.page_turn" for players
  159. send "{@prefix} &fFind the button is a game where you find the button!"
  160. wait 1.3 seconds
  161. play sound "item.book.page_turn" for players
  162. send "{@prefix} &fLook around the map of the game and find an &6Oak button"
  163. wait 2 seconds
  164. play sound "item.book.page_turn" for players
  165. send "{@prefix} &fStart playing a game by doing &7/Joingame Game_name &fand have a good time!"
  166. wait 2 seconds
  167. play sound "entity.player.levelup" for players
  168.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement