Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=---------Skript by ItsKirby ver: 1.0----------=
- options:
- prefix: &b&lFTB &7|
- load: &b&lFTB &7| &fReloaded Find the button skript!
- timer: 5 #amount of minutes set for a timer
- #=---------Leave credits ty----------=
- on join:
- joinitems(player)
- if {complete::%player's uuid%} is not set:
- set {complete::%player's uuid%} to 0
- if {failed::%player's uuid%} is not set:
- set {failed::%player's uuid%} to 0
- on load:
- send "{@load}" to all players
- command /ftb [<text>] [<text>] [<text>]:
- permission:*
- trigger:
- arg-1 is "game":
- arg-2 is "button":
- arg-3 is set:
- if {%arg-3%.game} is set:
- give 1 oak button named arg-3 to player
- send "{@prefix} &fGave you a button! Added button to button list!"
- if {%arg-3%.game} is not set:
- if arg-3 is not "list":
- send "{@prefix} &f%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f%arg-3%"
- if arg-3 is "list":
- send "{@prefix} &f%{Ftb.button::*}%"
- arg-2 is "delete":
- arg-3 is set:
- if {Ftb.button::*} contains arg-3:
- remove arg-3 from {Ftb.button::*}
- send "{@prefix} &fDeleted the game: &f%arg-3%"
- else:
- send "{@prefix} &f%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f%arg-3%"
- arg-2 is "create":
- arg-3 is set:
- if {%arg-3%.game} is not set:
- if arg-3 is not "list":
- add arg-3 to {Ftb.button::*}
- set {%arg-3%.game} to true
- send "{@prefix} &fCreated game: &7%arg-3%"
- else:
- send "{@prefix} &fCannot create this specific game! For skript purposes"
- else:
- send "{@prefix} &fGame has already been created!"
- arg-2 is "spawn":
- arg-3 is set:
- if {%arg-3%.game} is set:
- set {location::%arg-3%} to location of player
- send "{@prefix} &fSet your location for spawn for game: &7<%arg-3%>"
- else:
- send "{@prefix} &7%arg-3% &fDoesn't exist! Create one using &7/Ftb game create &f<%arg-3%>"
- arg-1 is not set:
- send "{@prefix} &fUsage for this command: &7/Ftb &f<game> <create <game>|spawn <game>|button <game|set>|remove <button> <game>"
- on place:
- if event-item is oak button:
- if {Ftb.button::*} contains player's tool's name:
- add location of event-block to {Ftb.button.location::*}
- send "{@prefix} &fSet button location of &7%player's tool%"
- on break:
- player has permission "*":
- if event-block is oak button:
- if {Ftb.button.location::*} contains event-block's location:
- remove location of event-block from {Ftb.button.location::*}
- send "{@prefix} &fRemoved button location!"
- on right click:
- if event-block is oak button:
- if {playing::*} contains player's name:
- if {Ftb.button.location::*} contains event-block's location:
- complete(player)
- command /joingame [<text>]:
- trigger:
- if {playing::*} doesn't contain player's name:
- if arg-1 is set:
- if {%arg-1%.game} is set:
- if {%arg-1%.game} is true:
- set {Ftb::spawn} to location of player
- add player's name to {playing::*}
- teleport player to {location::%arg-1%}
- wait 1 tick
- send title "&6&lGame: &f%arg-1%" with subtitle "&7Find the button!" to player for 2 seconds
- set {%player's uuid%.timer} to {@timer}
- else:
- send "{@prefix} &cThis game is in maintenace mode, come back later!"
- else:
- send "{@prefix} &fThis game doesn't exist! Do &7/gamelist &ffor games!"
- else:
- send "{@prefix} &fUsage of this command: &7/joingame &f<gamename>"
- else:
- send "{@prefix} &fCannot play another game while in running game!"
- command /gamelist:
- trigger:
- send "{@prefix} &f%{Ftb.button::*}%"
- every 1 minute:
- loop all players:
- if {%loop-player's uuid%.timer} is 0:
- lost(loop-player)
- delete {%loop-player's uuid%.timer}
- else:
- remove 1 from {%loop-player's uuid%.timer}
- send "{@prefix} &fYou have &6%{%loop-player's uuid%.timer}% &fminute left!" to loop-players
- function lost(p: player):
- set {_u} to uuid of {_p}
- send title "&6&lYou took too long!" with subtitle "&7Try again!" to {_p} for 3 seconds
- add 1 to {failed::%{_u}%}
- wait 2 seconds
- clear {_p}'s inventory
- teleport {_p} to {Ftb::spawn}
- remove {_p}'s name from {playing::*}
- function joinitems(p: player):
- set {_u} to uuid of {_p}
- clear {_p}'s inventory
- set slot 0 of {_p}'s inventory to paper named "&6Info" with lore "&7Right-click for help"
- 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}%}%"
- function complete(p: player):
- set {_u} to uuid of {_p}
- send title "&6&lYou completed the level!" with subtitle "&7Play another!" to {_p} for 3 seconds
- add 1 to {complete::%{_u}%}
- wait 3 seconds
- clear {_p}'s inventory
- teleport {_p} to {Ftb::spawn}
- remove {_p}'s name from {playing::*}
- joinitems({_p})
- on right click:
- player's tool's name is "&6Info":
- player has permission "*":
- play sound "item.book.page_turn" for players
- send "{@prefix} &fThank you for using this skript!"
- wait 2.5 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fStart by creating a game! &7/Ftb game create Your_game_name"
- wait 3 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fSet the game's start location! &7/Ftb game spawn Your_game_name"
- wait 3 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fGive yourself the game button and place it in the game's map! &7/Ftb game button Your_game_name"
- wait 4 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fAnd you're done! Play a game by doing &7/Joingame Your_game_name &fand have a good time!"
- wait 3 seconds
- play sound "entity.player.levelup" for players
- player does not have permission "*":
- play sound "item.book.page_turn" for players
- send "{@prefix} &fFind the button is a game where you find the button!"
- wait 1.3 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fLook around the map of the game and find an &6Oak button"
- wait 2 seconds
- play sound "item.book.page_turn" for players
- send "{@prefix} &fStart playing a game by doing &7/Joingame Game_name &fand have a good time!"
- wait 2 seconds
- play sound "entity.player.levelup" for players
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement