Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on quit:
- if {queue::*} contains {_p}:
- queue(player)
- if {ingame::*} contains {_p}:
- elim(player, "&7thought the map was too spooky.")
- function queue(p: offlineplayer):
- if {queue::*} contains {_p}:
- remove {_p} from {queue::*}
- if {start} is set:
- if size of {queue::*} = 3:
- delete {start}
- send formatted "&7Start cancelled." to all players
- else:
- add {_p} to {queue::*}
- if size of {queue::*} = 4:
- if {noManualStart} is set:
- start()
- command /start [<text>]:
- permission: op
- permission message: &cno
- trigger:
- if {noManualStart} is not set:
- if {start} is not set:
- start()
- else:
- send "&6&lMHDrop &7The game already started."
- else:
- send "&6&lMHDrop &7Manual start isn't on."
- function start():
- set {start} to true
- teleportCountdown()
- startCountdown()
- function teleportCountdown():
- loop 30 times:
- if {start} is set:
- if 30 - (loop-number - 1) = 30, 10, 5, 3, 2 or 1
- send formated "&6&lMHWool &7Teleporting in &e%30 - (loop-number - 1)% &7seconds." to all players
- wait 1 second
- else:
- stop loop
- function startCountdown():
- loop 10 times:
- if {start} is set:
- if 10 - (loop-number - 1) = 10, 5, 3, 2 or 1
- send formated "&6&lMHWool &7Starting in &e%10 - (loop-number - 1)% &7seconds." to all players
- wait 1 second
- else:
- stop loop
- if {start} is set:
- delete {start}
- set {started} to true
- send formatted "&6&lMHWool &7The game has started!" to all players
- set {ingame::*} to {queue::*}
- resetLoot()
- function resetLoot():
- set {_var::*} to {chestLoc::*} where [setLoot(input) = true]
- function setLoot(l: location) :: boolean:
- set block at {_l} to chest
- loop (random integer between 3 and 10 times):
- set slot (random integer between 0 and 26) of inventory of block at {_l} to random element out of {lootTable::*}
- command /queue [<text>]:
- aliases: q
- cooldown: 2 seconds
- cooldown message: &cThis command is on cooldown! %remaining time%
- trigger:
- if arg-1 is not "join", "auto" or "leave":
- send "&8&m----------"
- send "&a/queue join"
- send "&a/queue auto"
- send "&a/queue leave"
- send "&8&m----------"
- cancel cooldown
- else:
- if arg-1 is "join" or "leave":
- if arg-1 is "join":
- if {queue::*} doesn't contain player:
- queue(player)
- else:
- send "&cYou're already in the queue!"
- cancel cooldown
- else:
- if {queue::*} contains player:
- queue(player)
- else:
- send "&cYou're not in the queue!"
- cancel cooldown
- else:
- if {autoqueue::%player%} is not set:
- set {autoqueue::%player%} to true
- send "&aEnabled Auto Queue!"
- else:
- delete {autoqueue::%player%}
- send "&cDisabled Auto Queue!"
- cancel cooldown
- function endGame(winner: offlineplayer):
- send formatted "", "&6&lMHWool &e%{_winner}% &7has won the match!" and "" to all players
- set {wins::%{_winner}%} to ({wins::%{_winner}%} ? 0) + 1
- console command "/resetGame"
- function elim(p: offlineplayer, t: text="&7was eliminated!"):
- if {ingame::*} contains {_p}:
- remove {_p} from {ingame::*}
- send title "&c&lYou Died!" with subtitle "&7Better luck next time!" to {_p}
- send "&6&lMHDrop &e%{_p}% &7%{_t}%"
- if size of {ingame::*} is 1:
- set {_winner} to first element out of {ingame::*}
- endGame({_winner})
- on death of player:
- if {ingame::*} contains victim:
- if attacker is not a player:
- elim("%victim%" parsed as offlineplayer)
- else:
- elim("%victim%" parsed as offlineplayer, "&7was eliminated by &e%attacker%")
- command /resetGame [<text>]:
- permission: op
- permission message: &cno
- trigger:
- delete {started}
- delete {start}
- delete {ingame::*}
- command /addloc [<text>]:
- permission: op
- permission message: &cno
- trigger:
- add location of block at player to {chestLoc::*}
- send formatted "&6&lMHDrop &7Added a chest location to &e%location of block at player%&7!"
- command /addloot [<text>]:
- permission: op
- permission message: &cno
- trigger:
- if player's tool is not air:
- add player's tool to {lootTable::*}
- send formatted "&6&lMHDrop &7Added &e%player's tool% &7to the loot table."
- else:
- send formatted "&6&lMHDrop &7Please hold an item."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement