Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rightclick on sign:
- Queue(player) if {GameRunning?} is not set
- send "Game is currently running" if {GameRunning?} is set
- function Queue(p: player):
- {Queue::*} contains {_p}:
- remove {_p} from {Queue::*}
- send "&cYou left the queue." to {_p}
- else:
- add {_p} to {Queue::*}
- send "&aYou joined the queue." to {_p}
- if size of {Queue::*} > 1:
- Timer()
- function Timer():
- set {_timer} to 10
- while {_timer} != 0:
- broadcast "&eAnvilDrops &8» &7The game will start in %{_timer}% seconds!" if mod({_timer},5) = 0
- broadcast "&eAnvilDrops &8» &7The game will start in %{_timer}% second%Plural({_timer})%!" if {_timer} <= 5
- remove 1 from {_timer}
- wait second
- broadcast "The game starts!"
- Start()
- function Start():
- size of {Queue::*} > 1:
- set {GameRunning?} to true
- set {Round} to 1
- loop {Queue::*}:
- set {_x} to random number between -168.3 and -181.7
- set {_z} to random number between -109.3 and -133.7
- teleport loop-value to location({_x}, 169, {_z}, world("world"), 0.01, 0.01)
- else:
- broadcast "&cNot enough players to start!"
- every 5 seconds:
- {GameRunning?} is true
- set {_Drop} to 10*1.1^({Round}-1)
- set {_Drop} to 349 if {_Drop} > 349
- broadcast "&eAnvilDrops &8» &dRound &b%{Round}%&d: &b%round({_Drop})% &danvils!"
- loop {_Drop} times:
- findloc()
- while block at location({x}, 180, {z}, world("world")) is anvil:
- findloc()
- set block at location({x}, 180, {z}, world("world")) to anvil
- add 1 to {Round}
- disconnect:
- remove player from {Queue::*}
- death:
- {Queue::*} contains victim
- if size of {Queue::*} > 1:
- broadcast "%{Queue::*}% wins!"
- loop {Queue::*}:
- add 100 to {Coins::%loop-index%}
- remove victim from {Queue::*}
- function findloc():
- set {x} to random integer between -169 and -182
- set {z} to random integer between -110 and -134
- command round <number>:
- trigger:
- set {Round} to arg
- command resetqueue:
- trigger:
- clear {Queue::*}
- clear {GameRunning?}
- function Plural(n: number) :: string:
- {_n} != 1:
- return "s"
- else:
- return ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement