Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #todo
- #fix the spawn bug
- #the top 3 count is incomplete
- #haven't make give player reward
- #add a variable to lock them cannot use the sign to spam the autostart message
- #player cannot hoe land when script reload
- #player cannot hoe land when script reload
- #continue scoreboard format fix
- #
- options:
- HoePrefix: &e[&aHoeHoeHoe&e]
- HoeItem: "&fMagic Hoe"
- HoeNoSelfBlockFound: "&c&lNo Self color blocks found"
- #Scoreboard
- HoeBoardTitle: "&a&lHoe Hoe Hoe"
- HoeBoardWaiting: "&eWaiting..."
- HoeBoardStarting: "&eStarting..."
- HoeBoardStartingIn: "&eStarts in %{HoeReadyCount}%"
- HoeBoardEndsIn: "&eEnds in %{EndGameTimer}%"
- HoeBoardLastLine: "&b&lSimpleMinigame"
- HoeBoardScoreTitle: "&eScore of player:"
- HoePlayerCount: &b%{HoePlayerCount}%&e/&b16
- #Title
- HoeTitle: "&aHoe Hoe Hoe"
- HoeSubTitle: "&2SimpleMinigameServer"
- #Sound
- HoeSound: "step.gravel"
- HoeLv1Sound: "note.pling"
- HoeLv2Sound: "random.successful_hit"
- #Sign
- HoeSignLine1: "&1[&4hhh&1]"
- HoeSignWaiting: &9Waiting...
- HoeSignStarting: &aStarting...
- HoeSignEndingIn: &1Ending in %{EndGameTimer}%
- HoeSignEnding: &9Ending...
- HoeSignPlayerCount1: &b0&e/&b16
- HoeSignPlayerCount2: &b%{HoePlayerCount}%&e/&b16
- #messages via chat
- HoeGameFull: &eThe arena is full. Please wait untill the game ends.
- HoeAlreadyInGame: &eYou are already in the arena.
- HoeGameInProcess: &eThe game is in process, wait or join later.
- HoeHasJoined: &e%event-player% has joined (&b%{HoePlayerCount}%&e/&b16&e)!
- HoeYouLeft: &eYou left the arena.
- HoeNotInAnyArena: &eYou are not in any arena.
- HoeDataBaseReset: &cResetted.
- HoeStartingInDiv5: &eThe game will starts in %{HoeStartCountDown}% second.
- HoeStartingBig1: &eThe game will starts in %{HoeStartCountDown}% seconds.
- HoeStarting1Second: &eThe game will starts in 1 second.
- HoeMessageWhileTitle: &aGame starts in %{HoeReadyCount}% seconds
- HoeNewSignSet: &eYou setted a new join sign.
- HoeDeletedSign: &eYou deleted a join sign
- HoeGameSpawnSet: &eYou setted the gamespawn to
- HoeMainLobbySet: &eYou setted the mainlobby to
- HoeWaitRoomSet: &eYou setted the waitroom to
- HoeGameStopped: &eThe game has stopped
- HoeUnknownCommand: &eUnknown command. Please type /hhh help for help
- #variables:
- # #player variables
- # {HoeSelfWoolColor.%player%} = 0
- # {HoeBlockToRestore::*} = 0
- # {HoeFirstBlock.%player%} = 0
- # {HoePlayerInGame.%player%} = 0
- # {HoePlayerScoreCount.%player%} = 0
- # #map variables
- # {HoeCurrentWoolColor} = 0
- # {HoePlayerCount} = 0
- # {GameSpawn} = 0
- # {MainLobby} = 0
- # {GameWaitRoom} = 0
- # {ArenaLock} = 0
- # {AutoStartRenewLock} = 0
- # {EndGameTimer} = 0
- # {DefaultEndGameTimer} = 180
- # {Top1Players} = 0
- # {Top2Players} = 0
- # {Top3Players} = 0
- # {HoeStartCountDown} = 0
- # {JoinCountDownLock} = 0
- # {HoeBlockAllowHoe.%player%} = 0
- variables:
- {DefaultEndGameTimer} = 180
- {HoeDynamicSign::*} = 0
- on script load:
- loop all players:
- delete {HoeSelfWoolColor.%loop-player%}
- delete {HoeFirstBlock.%loop-player%}
- delete {HoePlayerInGame.%loop-player%}
- delete {HoePlayerScoreCount.%loop-player%}
- delete {HoeBlockToRestore::*}
- set {HoeCurrentWoolColor} to 0
- delete {HoePlayerCount}
- delete {ArenaLock}
- delete {AutoStartRenewLock}
- set {EndGameTimer} to 180
- set {DefaultEndGameTimer} to 180
- delete {Top1Players}
- delete {Top2Players}
- delete {Top3Players}
- delete {HoeStartCountDown}
- delete {HoeBoardState}
- delete {JoinCountDownLock}
- #===============
- #===============
- #Function
- #===============
- #===============
- function HoeBoard(Empty: integer):
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- if {JoinCountDownLock} is not set:
- wipe loop-player's sidebar
- set name of sidebar of loop-player to {@HoeBoardTitle}
- set score "" in sidebar of loop-player to 999
- if {HoeBoardState} = 1:
- set score {@HoeBoardWaiting} in sidebar of loop-player to 0
- if {HoeBoardState} = 2:
- set score {@HoeBoardStarting} in sidebar of loop-player to 0
- if {HoeBoardState} = 3:
- set score {@HoeBoardStartingIn} in sidebar of loop-player to 999
- if {HoeBoardState} = 4:
- set score {@HoeBoardEndsIn} in sidebar of loop-player to 998
- set score " " in sidebar of loop-player to 997
- set score "&e%loop-player%:" in sidebar of loop-player to {HoePlayerScoreCount.%loop-player%}
- set score " " in sidebar of loop-player to -1
- set score {@HoeBoardLastLine} in sidebar of loop-player to -2
- if {HoeBoardState} = 5:
- set score {@HoeBoardScoreTitle} in sidebar of loop-player to 998
- set score " " in sidebar of loop-player to 997
- loop all players:
- if {HoePlayerInGame.%loop-player-2%} is 1:
- set score "&e%loop-player-2%:" in sidebar of loop-player-1 to {HoePlayerScoreCount.%loop-player-2%}
- set score " " in sidebar of loop-player to -1
- set score " " in sidebar of loop-player to -1
- set score {@HoeBoardLastLine} in sidebar of loop-player to -2
- if {HoeBoardState} is not 4 or 5:
- set score " " in sidebar of loop-player to -1
- set score "{@HoePlayerCount}" in sidebar of loop-player to -2
- set score " " in sidebar of loop-player to -3
- set score {@HoeBoardLastLine} in sidebar of loop-player to -4
- delete {HoeBoardState}
- #===============
- #===============
- function HoeCountDownMsg(Time: integer):
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- if {_Time} is divisible by 5:
- message "{@HoeStartingInDiv5}" to loop-player
- else if {_Time} > 1:
- message "{@HoeStartingBig1}" to loop-player
- else if {_Time} = 1:
- message "{@HoeStarting1Second}" to loop-player
- #===============
- #===============
- function HoeAutoStart(CountDown: integer, Player: player):
- if {HoePlayerCount} > 1:
- set {HoeStartCountDown} to {_CountDown}
- if {JoinCountDownLock} is 0:
- set {JoinCountDownLock} to 1
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- wipe loop-player's sidebar
- while {HoeStartCountDown} > 0:
- HoeCountDownMsg({HoeStartCountDown})
- remove 1 from {HoeStartCountDown}
- wait 1 second
- make console execute command "/hoehoehoe start"
- delete {HoeStartCountDown}
- if {JoinCountDownLock} is 1:
- message "ðe autostart renew is blocked" to {_Player}
- function HoeTitleCountDown(Empty: integer):
- while {HoeReadyCount} > 0:
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- send loop-player title "&e%{HoeReadyCount}%" for 1 second
- message "{@HoeMessageWhileTitle}" to loop-player
- if {HoeReadyCount} is not 1 or 2 or 3:
- play raw sound {@HoeLv1Sound} at loop-player with pitch 1 volume 1
- else:
- play raw sound {@HoeLv2Sound} at loop-player with pitch 1 volume 1
- if {HoeReadyCount} < 6:
- set {ArenaLock} to 1
- set {HoeBoardState} to 3
- HoeBoard(3)
- remove 1 from {HoeReadyCount}
- wait 1 second
- function HoeDynamicSign(Empty: integer):
- set {_HoeSignTemp} to 0
- loop {HoeDynamicSign::*}:
- add 1 to {_HoeSignTemp}
- while {_HoeSignTemp} > 0:
- if {HoeDynamicSignState} = 1:
- set line 3 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignWaiting}"
- if {HoeDynamicSignState} = 2:
- loop {HoeDynamicSign::*}:
- set line 3 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignStarting}"
- if {HoeDynamicSignState} = 3:
- loop {HoeDynamicSign::*}:
- set line 3 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignEndingIn}"
- if {HoeDynamicSignState} = 4:
- loop {HoeDynamicSign::*}:
- set line 3 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignEnding}"
- if {HoePlayerCount} is not set:
- set line 4 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignPlayerCount1}"
- else:
- set line 4 of block at {HoeDynamicSign::%{_HoeSignTemp}%} to "{@HoeSignPlayerCount2}"
- remove 1 from {_HoeSignTemp}
- delete {hoedynamicsignstate}
- #===============
- #===============
- on right click:
- if target block is sign:
- if line 1 is {@HoeSignLine1}:
- if line 2 is "join":
- make event-player execute command "/hhh join"
- loop {HoeDynamicSign::*}:
- if location of clicked block = {HoeDynamicSign::%loop-index%}:
- set {_HoeSignAlreadyExist} to 1
- if {_HoeSignAlreadyExist} is not set:
- add location of clicked block to {HoeDynamicSign::*}
- message "{@HoePrefix} {@HoeNewSignSet}"
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- if line 2 is "leave":
- make event-player execute command "/hhh leave"
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- on break of sign:
- if line 1 is {@HoeSignLine1}:
- if line 2 is "join":
- loop {HoeDynamicSign::*}:
- if {HoeDynamicSign::%loop-index%} = location of event-block:
- delete {HoeDynamicSign::%loop-index%}
- message "{@HoePrefix} {@HoeDeletedSign}"
- #==============
- #==============
- #Default Game Logic
- #==============
- #==============
- on right click:
- if player's tool is diamond hoe named {@HoeItem}:
- if {HoePlayerInGame.%event-player%} is 1:
- if clicked block is grass:
- cancel event
- #===============
- #first block to hoe
- #===============
- if {HoeFirstBlock.%event-player%} is not set:
- set {HoeFirstBlock.%event-player%} to 1
- set {HoeBlockAllowHoe.%event-player%} to 1
- play raw sound {@HoeSound} at player with pitch 1 volume 1
- #==========
- #if self block found
- #==========
- else if block in front of clicked block is {HoeSelfWoolColor.%event-player%}:
- set {HoeBlockAllowHoe.%event-player%} to 1
- else if block behind clicked block is {HoeSelfWoolColor.%event-player%}:
- set {HoeBlockAllowHoe.%event-player%} to 1
- else if block left clicked block is {HoeSelfWoolColor.%event-player%}:
- set {HoeBlockAllowHoe.%event-player%} to 1
- else if block right clicked block is {HoeSelfWoolColor.%event-player%}:
- set {HoeBlockAllowHoe.%event-player%} to 1
- #==========
- #no self block found
- #==========
- if {HoeBlockAllowHoe.%event-player%} is not set:
- if {HoeFirstBlock.%event-player%} = 1:
- set action bar of event-player to {@HoeNoSelfBlockFound}
- #==========
- #set block
- #==========
- if {HoeBlockAllowHoe.%event-player%} = 1:
- add 1 to {HoePlayerScoreCount.%event-player%}
- add location of event-block to {HoeBlockToRestore::*}
- delete {HoeBlockAllowHoe.%event-player%}
- set block at location of clicked block to {HoeSelfWoolColor.%event-player%}
- play raw sound {@HoeSound} at event-player with pitch 1 volume 1
- set {HoeBoardState} to 4
- HoeBoard(4)
- on quit:
- delete {HoePlayerInGame.%event-player%}
- delete {HoeSelfWoolColor.%event-player%}
- delete {HoeFirstBlock.%event-player%}
- delete {HoePlayerInGame.%event-player%}
- delete {HoePlayerScoreCount.%event-player%}
- remove 1 from {HoePlayerCount}
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- command /hoehoehoe <text="help">:
- aliases: /hhh, /hoe
- trigger:
- #===============
- #===============
- #Join
- #===============
- #===============
- if arg-1 is "help":
- message ""
- message "&e==========[&eHoeHoeHoe&e]=========="
- message "&eSimpleMinigameServer"
- message "&aCommands:"
- message "&e/hoehoehoe"
- message "&aAliases: /hhh, /hoe"
- message "&ehelp: Show this help page"
- message "&ejoin: Join a game"
- message "&eleave | quit: Leave a game"
- message "&estart: Force start a game"
- message "&esetgamespawn: Set the game spawn"
- message "&esetmainlobby: Set the main lobby"
- message "&esetwaitroom: set the wait room"
- message "&e==============================="
- message ""
- else if arg-1 is "join":
- if {HoePlayerCount} > 15:
- message "{@HoePrefix} {@HoeGameFull}"
- if {HoePlayerInGame.%event-player%} is set:
- message "{@HoePrefix} {@HoeAlreadyInGame}"
- if {HoePlayerInGame.%event-player%} is not set:
- if {ArenaLock} is 1:
- message "{@HoePrefix} {@HoeGameInProcess}"
- if {ArenaLock} is not set:
- set {HoePlayerInGame.%event-player%} to 1
- add 1 to {HoePlayerCount}
- delete {HoeFirstBlock.%event-player%}
- set {HoeSelfWoolColor.%event-player%} to "wool:%{HoeCurrentWoolColor}%" parsed as item
- add 1 to {HoeCurrentWoolColor}
- set {HoeBoardState} to 1
- HoeBoard(1)
- HoeAutoStart({HoeStartCountDown}, event-player)
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- teleport event-player to {GameWaitRoom}
- set event-player's gamemode to survival
- clear event-player's inventory
- loop all players:
- if {HoePlayerInGame.%event-player%} is set:
- message "{@HoePrefix} {@HoeHasJoined}" to loop-player
- else if arg-1 is "quit" or "leave":
- if {HoePlayerInGame.%event-player%} is 1:
- teleport player to {MainLobby}
- delete {HoePlayerInGame.%event-player%}
- remove 1 from {HoePlayerCount}
- clear event-player's inventory
- wipe event-player's sidebar
- message "{@HoePrefix} {@HoeYouLeft}"
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- else:
- message "{@HoePrefix} {@HoeNotInAnyArena}"
- #===============
- #===============
- #reset all the stuff
- #===============
- #===============
- else if arg-1 is "reset":
- loop all players:
- set {HoeSelfWoolColor.%event-player%} to 0
- set {HoeFirstBlock.%event-player%} to 0
- set {HoePlayerScoreCount.%event-player%} to 0
- delete {HoePlayerInGame.%event-player%}
- set {HoeBlockToRestore::*} to 0
- set {HoeCurrentWoolColor} to 0
- set {HoePlayerCount} to 0
- set {DefaultEndGameTimer} to 180
- delete {EndGameTimer}
- delete {Top1Players}
- delete {Top2Players}
- delete {Top3Players}
- delete {ArenaLock}
- delete {JoinCountDownLock}
- delete {AutoStartRenewLock}
- delete {HoeDynamicSign::*}
- message "{@HoePrefix} {@HoeDataBaseReset}"
- #===============
- #===============
- #set the spawn that player will be teleport when join game
- #===============
- #===============
- else if arg-1 is "setgamespawn":
- set {GameSpawn} to location of event-player
- message "{@HoePrefix} {@HoeGameSpawnSet}"
- message "{@HoePrefix} &e%{GameSpawn}%"
- else if arg-1 is "setmainlobby":
- set {MainLobby} to location of player
- message "{@HoePrefix} {@HoeMainLobbySet}"
- message "{@HoePrefix} &e%{MainLobby}%"
- else if arg-1 is "setwaitroom":
- set {GameWaitRoom} to location of player
- message "{@HoePrefix} {@HoeWaitRoomSet}"
- message "{@HoePrefix} &e%{GameWaitRoom}%"
- #===============
- #===============
- #force stop arena
- #===============
- #===============
- else if arg-1 is "stop":
- delete {EndGameTimer}
- loop all players:
- if {HoePlayerInGame.%event-player%} is 1:
- message "{@HoePrefix} {@HoeGameStopped}" to loop-player
- set {HoeDynamicSignState} to 4
- HoeDynamicSign(4)
- #===============
- #===============
- #force start arena
- #===============
- #===============
- else if arg-1 is "start":
- set {HoeSignState} to 1
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- teleport loop-player to {GameSpawn}
- send loop-player title {@HoeTitle} with subtitle {@HoeSubTitle} for 3 seconds
- set {HoePlayerScoreCount.%loop-player%} to 0
- set {HoeDynamicSignState} to 2
- HoeDynamicSign(2)
- set {HoeBoardState} to 2
- HoeBoard(2)
- wait 5 seconds
- set {HoeReadyCount} to 10
- HoeTitleCountDown({HoeReadyCount})
- loop {HoeReadyCount}+1 times:
- wait 1 second
- #====================
- #game start and give player item
- #show the time left
- #====================
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- give loop-player a diamond hoe named {@HoeItem}
- set {EndGameTimer} to {DefaultEndGameTimer}
- while {EndGameTimer} > 0:
- set {HoeBoardState} to 4
- HoeBoard(4)
- set {HoeDynamicSignState} to 3
- HoeDynamicSign(3)
- remove 1 from {EndGameTimer}
- wait 1 second
- delete {EndGameTimer}
- #===============
- #End Game
- #===============
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- clear loop-player's inventory
- heal loop-player
- set {HoeBoardState} to 5
- HoeBoard(5)
- set {HoeDynamicSignState} to 4
- HoeDynamicSign(4)
- wait 5 seconds
- #===============
- #system reset
- #===============
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- wipe loop-player's sidebar
- teleport loop-player to {MainLobby}
- set event-player's gamemode to survival
- loop all players:
- if {HoePlayerInGame.%loop-player%} is 1:
- delete {HoeSelfWoolColor.%loop-player%}
- delete {HoeFirstBlock.%loop-player%}
- delete {HoePlayerInGame.%loop-player%}
- delete {HoePlayerScoreCount.%loop-player%}
- #set {HoeSelfWoolColor.%event-player%} to "wool:%{HoeCurrentWoolColor}%" parsed as item
- set {HoeCurrentWoolColor} to 0
- delete {HoePlayerCount}
- set {EndGameTimer} to {DefaultEndGameTimer}
- delete {Top1Players}
- delete {Top2Players}
- delete {Top3Players}
- delete {ArenaLock}
- delete {JoinCountDownLock}
- set {HoeDynamicSignState} to 1
- HoeDynamicSign(1)
- #===============
- #restore the arena to grass
- #===============
- loop {HoeBlockToRestore::*}:
- set block at {HoeBlockToRestore::%loop-index%} to grass
- delete {HoeBlockToRestore::%loop-index%}
- else:
- message "{@HoePrefix} {@HoeUnknownCommand}"
- on drop:
- if event-item is a diamond hoe named {@HoeItem}:
- cancel event
- on break:
- if {HoePlayerInGame.%event-player%} is 1:
- cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement