Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables:
- {hg.%player%.hasjoined} = 1 #1 if false, 0 if true
- {hg.current.peoplejoined} = 0 #How many people in the game
- {hg.game.open} = 1 #1 if false, 0 if true
- {hg.game.playersinworld} = 0
- on weather change:
- cancel event
- command /hungergames:
- executable by: players
- trigger:
- broadcast "Hunger games starting in 2 minutes! Type /join to join!" #Broadcasts the game(i lost the game)
- set {hg.game.open} to 0 #The game is open for playing
- wait 2 minutes #2 minutes until start
- loop players in world:
- if {hg.%player%.hasjoined} is less than 1:
- add 1 to {hg.current.peoplejoined} #See how many people have joined
- if {hg.current.peoplejoined} is less than 2:
- message "Game canceled. At least 2 people need to join." #You can't have a 1-player Hunger Games!
- exit
- loop players in world:
- if {hg.%player%.hasjoined} is less than 1:
- make player execute command "/warp hungergamesspawn" #TP them to the same spot
- set {hg.game.open} to 1 #The game is now closed!
- disable pvp #No one can attack anyone for 2 minutes
- broadcast "Everyone is invincible for 2 minutes. Go!"
- wait 2 minutes
- enable pvp #DUN DUN DUN
- on death of player:
- set {hg.%player%.hasjoined} to 1 #That player died.
- add -1 to {hg.game.playersinworld} #Updates variables
- add -1 to {hg.current.peoplejoined}
- create explosion of force 4 at player #Cannonfire, mwahaha
- kick the player on account of "You Died!" #I know, kinda cruel.
- if {hg.game.playersinworld} is less than 2: #Checks for a winner
- broadcast "We have a winner for the Hunger Games!"
- loop players:
- if {hg.%player%.hasjoined} is less than 1: #WINNER!
- message "You won!"
- give 2 gold ingots to the player #reward
- else:
- clear the player's inventory #VERY cruel.
- loop players:
- set {hg.%player%.hasjoined} to 1
- set {hg.current.peoplejoined} to 0
- set {hg.game.playersinworld} to 0
- broadcast "Game over. If you didn't win, better luck next time."
- command /join:
- executable by: players
- trigger:
- if {hg.game.open} is more than 0: #You can only join an existiing game!
- message "There isn't a Hunger Games going on!"
- exit
- message "You just joined the Hunger Games!"
- set {hg.%player%.hasjoined} to 0 #May the odds be ever in your favor.
- add 1 to {hg.game.playersinworld}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement