Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on quit:
- if {queue::*} contains player:
- queue(player)
- if {ingame::*} contains player:
- elim(player, "&7thought the map was too spooky.")
- on join:
- spawn(player)
- while player is online:
- if block under player is smooth sandstone:
- elim(player)
- wait 5 ticks
- function queue(p: offlineplayer):
- if {queue::*} contains {_p}:
- remove {_p} from {queue::*}
- send formatted "&6&lMHWool &7You left the queue!" to {_p}
- else:
- send formatted "&6&lMHWool &7You joined the queue!" to {_p}
- add {_p} to {queue::*}
- on load:
- execute console command "/resetGame"
- command /start [<text>]:
- permission: op
- permission message: &cno
- trigger:
- if {autoStart} is not set:
- if {start} is not set:
- start()
- else:
- send "&6&lMHWool &7The game already started."
- else:
- send "&6&lMHWool &7Auto starting is on!"
- function start():
- if {notready} is set:
- stop
- set {start} to true
- teleportCountdown()
- function teleportCountdown():
- loop 30 times:
- if {start} is set:
- if 30 - (loop-number - 1) = 30, 10, 5, 3, 2 or 1:
- send formatted "&6&lMHWool &7Teleporting in &e%30 - (loop-number - 1)% &7seconds." to all players
- wait 1 second
- else:
- stop loop
- startCountdown()
- function randomTP(player: player) :: boolean:
- if {queue::*} contains {_player}:
- teleport {_player} to random location out of {spawns::*}
- getReady({_player})
- function startCountdown():
- set {_randomSpawn::*} to all players where [randomTP(input) is true]
- loop 10 times:
- if {start} is set:
- if 10 - (loop-number - 1) = 10, 5, 3, 2 or 1:
- send formatted "&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::*}
- set (all players where [{ingame::*} contains input])'s gamemode to survival
- set {_gettingReady::*} to all players where [getReady(input) is true]
- #resetLoot()
- wait 10 seconds
- loop 120 times:
- if {started} is set:
- add 1 to {highestLayer}
- set y-coordinate of {reset::2} to 4+{highestLayer}
- fillLayer({game::1}, {game::2})
- set {game::1} to block above {game::1}
- set {game::2} to block above {game::2}
- wait 7 seconds
- clear {data::*}
- #function resetLoot():
- # set {_var::*} to {chestLoc::*} where [setLoot(input) = true]
- on damage:
- attacker is a player
- victim is a player
- if {ingame::*} does not contain attacker:
- send "&cYou may not PvP at this time!" to attacker
- cancel event
- else if {ingame::*} does not contain victim:
- send "&cYou may not PvP at this time!" to attacker
- cancel event
- else:
- set maximum damage delay of attacker to 0 seconds
- command /addspawn:
- permission: *
- trigger:
- add player's location to {spawns::*}
- send "&aA random spawnpoint was added at your location!"
- #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::*}
- on right click on chest:
- if {checked::*} contains event-location:
- stop
- if {start} is set:
- send "&cPlease wait for the game to start before you get loot!"
- cancel event
- stop
- if {started} is not set:
- stop
- player's gamemode is creative:
- stop
- clear inventory of event-block
- loop (random integer between 3 and 6) times:
- if {firstChest::*} does not contain player:
- chance of 50%:
- set slot (random integer between 0 and 26) of event-block to 64 white wool
- else:
- set slot (random integer between 0 and 26) of event-block to random item out of {lootTable::*}
- add player to {firstChest::*}
- else:
- set slot (random integer between 0 and 26) of event-block to random item out of {lootTable::*}
- add event-location to {checked::*}
- # command /placechests:
- # permission: *
- # trigger:
- # if {placing::%player%} is not set:
- # set {placing::%player%} to true
- # send "&aYou are now placing event chests!"
- # else:
- # clear {placing::%player%}
- # send "&cPlacing disabled!"
- # on place of chest:
- # player has permission "*"
- # if {placing::%player%} is set:
- # add event-location to {chestLoc::*}
- command /queue [<text>]:
- aliases: /q
- cooldown: 1 second
- cooldown message: &cPlease wait %remaining time% &cbefore continuing!
- trigger:
- if arg-1 is not set:
- send "&c/queue (join|leave|auto)"
- stop
- if arg-1 is "join" or "leave":
- queue(player)
- else:
- if {autoqueue::*} does not contain player:
- send "&aEnabled auto queue!"
- add player to {autoqueue::*}
- add player to {queue::*} if {queue::*} does not contain player
- if {autoStart} is set:
- if size of {queue::*} >= 4:
- if {started} is not set:
- if {start} is not set:
- if {notready} is not set:
- broadcast "&aGame starting! Reached enough players!"
- start()
- else:
- send "&cDisabled auto queue!"
- remove player from {autoqueue::*}
- remove player from {queue::*}
- if {autoStart} is set:
- if size of {queue::*} < 4:
- if {started} is not set:
- if {start} is not set:
- if {notready} is not set:
- broadcast "&cAutomatic stop cancelled! Not enough players!"
- # 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
- wait 2 seconds
- set {_all::*} to all players where [spawnAll(input) is true]
- console command "/resetGame"
- function spawnAll(player: player) :: boolean:
- spawn({_player})
- function elim(p: offlineplayer, t: text="&7was eliminated!"):
- if {ingame::*} contains {_p}:
- remove {_p} from {ingame::*}
- set {_p}'s gamemode to spectator
- send title "&c&lYou Died!" with subtitle "&7Better luck next time!" to {_p}
- send formatted "&6&lMHWool &e%{_p}% &7%{_t}%" to all players
- if size of {ingame::*} is 1:
- set {_winner} to first element out of {ingame::*}
- endGame({_winner})
- # set {_all::*} to all players where [spawnAll(input) is true]
- wait 2 seconds
- send title "" with subtitle "" to {_p}
- on death of player:
- set {_pos} to victim's location
- force victim to respawn
- 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%")
- wait a tick
- teleport victim to {_pos}
- function spawn(player: player):
- teleport {_player} to {spawn}
- set {_player}'s gamemode to adventure
- clear {_player}'s inventory
- getReady({_player})
- function getReady(player: player) :: boolean:
- set {_player}'s health to {_player}'s max health
- set {_player}'s food to 20
- command /spawn:
- trigger:
- if {ingame::*} contains player:
- send "&cYou may not use this command now!"
- stop
- spawn(player)
- command /setspawn:
- permission: *
- trigger:
- set {spawn} to player's location
- send "&aSpawn was set!"
- function restore():
- set blocks at {placed::*} to air
- clear {placed::*}
- on break:
- player's gamemode is not creative
- if {placed::*} does not contain event-location:
- send "&cYou can only break player placed blocks!"
- cancel event
- stop
- if y-coordinate of event-block < {highestLayer}:
- send "&cYou can not break this low!"
- cancel event
- stop
- on place:
- player's gamemode is not creative
- add event-location to {placed::*}
- set {restore::%event-location%} to block at event-location
- on command:
- if command is "me" or "minecraft:me":
- cancel event
- send "&cBad boy"
- command /resetGame [<text>]:
- permission: op
- permission message: &cno
- trigger:
- delete {started}
- delete {start}
- delete {ingame::*}
- clear {checked::*}
- clear {highestLayer}
- remove (all players where [{autoqueue::*} does not contain input]) from {queue::*}
- delete all entities where [input is not a player]
- execute console command "minecraft:kill @e[type=minecraft:ender_pearl]" # fixes a annoying bug
- clear {firstChest::*}
- set {game::1} to {test::1}
- set {game::2} to {test::2}
- set {_b::*} to all blocks within {reset::1} and {reset::2}
- set {notready} to true
- broadcast "&cMap resetting. Please wait!"
- wait a tick
- loop {_b::*}:
- if block at loop-value is smooth sandstone:
- set block at loop-value to air
- restore()
- # wait a tick
- clear {notready}
- broadcast "&aMap reset! Ready to continue!"
- command /addloc [<text>]:
- permission: op
- permission message: &cno
- trigger:
- add location of block at player to {chestLoc::*}
- send formatted "&6&lMHWool &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&lMHWool &7Added &e%player's tool% &7to the loot table."
- else:
- send formatted "&6&lMHWool &7Please hold an item."
- function fillLayer(start: block, end: block):
- getLayers({_start},{_end})
- clear {data::*}
- function getLayers(start: block, end: block):
- loop 5 times:
- loop 14 times:
- wait 2 ticks # 1/4th a second
- fillRow(({data::start} ? {_start}), ({data::end} ? {_end}))
- function fillRow(start: block, end: block):
- set {_b::*} to all blocks within {_start} and {_end}
- loop {_b::*}:
- if {started} is set:
- if block at loop-value is air or cobweb: # Moved the check here since the where [] expression didnt seem to work
- set block at loop-value to smooth sandstone
- set {data::start} to block 1 east of {_start}
- set {data::end} to block 1 east of {_end}
- on rightclick:
- if line 2 of clicked block contains "Queue":
- make player execute command "queue join"
- on chat:
- if player has permission "op":
- set chat format to "&6%player%: &f%colored message%"
- else:
- if {chat} is set:
- cancel event
- send "&cChat is for staff only right now."
- else:
- set chat format to "&7%player%: &f%message%"
- on join:
- set join message to "&a[+] &7%player%"
- on quit:
- set quit message to "&c[-] &7%player%"
- on command "list":
- cancel event
- clear {staff::*}
- loop all players:
- if loop-player has permission "op":
- add loop-player to {staff::*}
- send ""
- send "&bEvent Hosts Online: &e%{staff::*}%"
- send ""
- command /chat:
- permission: op
- permission message: &cxd
- trigger:
- if {chat} is not set:
- set {chat} to 1
- broadcast ""
- broadcast "&cChat disabled by %player%"
- broadcast ""
- else:
- delete {chat}
- broadcast ""
- broadcast "&aChat enabled by %player%"
- broadcast ""
- command /broadcast [<text>]:
- aliases: /bc
- permission: op
- permission message: &clol should've joined the community events team or be a mod
- trigger:
- if arg 1 is set:
- broadcast ""
- broadcast "&6&lMHWool &7- &f%arg-1%"
- broadcast ""
- loop all players:
- send loop-player title "&6EVENT" with subtitle "&f%arg-1%" for 6 seconds
- else:
- send "&9Message> &cErr...something went wrong? (Look familiar lol &3&lTRAINEE&c)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement