Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &6Tycoon&8:&7
- function sendBalance():
- if {tc.loopingBalance} is true:
- stop
- set {tc.loopingBalance} to true
- while {tc.loopingBalance} is true:
- if {tc.stopped} is true:
- delete {tc.loopingBalance}
- if size of online players is 0:
- delete {tc.loopingBalance}
- else:
- loop all players:
- send actionbar "&6Coins&8: &e%{tc.%uuid of loop-player%.balance}%" to loop-player
- wait 40 ticks
- on join:
- if {tc.%uuid of player%.balance} is not set:
- set {tc.%uuid of player%.balance} to 0
- sendBalance()
- on enable:
- while {tc.loopingBalance} is true:
- wait 10 ticks
- if {tc.stopped}:
- sendBalance()
- delete {tc.stopped}
- on disable:
- if {tc.loopingBalance} is true:
- set {tc.stopped} to true
- function setLineData(sign: Location, line: String, firstType: String, secondType: String):
- set {_lines::*} to {_line} split at " "
- if size of {_lines::*} is not 2:
- stop
- set {_firstValue} to {_lines::1} parsed as an integer
- set {_secondValue} to {_lines::2} parsed as an integer
- if {_firstValue} is set:
- if {_secondValue} is set:
- if {_firstValue} > 0:
- if {_secondValue} > 0:
- set {tc.signdata.%{_sign}%.%{_firstType}%} to {_firstValue}
- set {tc.signdata.%{_sign}%.%{_secondType}%} to {_secondValue}
- function updateSignVariables(sign: Location):
- add 1 to {tc.signdata.%{_sign}%.level}
- add {tc.signdata.%{_sign}%.costIncrease} to {tc.signdata.%{_cost}%.cost}
- if {tc.signdata.%{_sign}%.level} >= {tc.signdata.%{_sign}%.maxLevel}:
- set {tc.signdata.%{_sign}%.cost} to -1
- function updateSign(sign: Location, block: Block):
- # Update sign?
- if {tc.signdata.%{_sign}%.cost} < 0:
- set line 3 of {_block} to "&eCost&8: &7%{tc.signdata.%{_sign}%.cost}%"
- else:
- set line 3 of {_block} to "&eCost&8: &7Max Level"
- set line 4 of {_block} to "&bLevel&8: &7%{tc.signdata.%{_sign}%.level}%"
- on sign change:
- if line 1 is not "Tycoon":
- stop
- setLineData(location of event-block, line 4 of event-block, "level", "maxLevel")
- setLineData(location of event-block, line 3 of event-block, "cost", "costIncrease")
- # check if level >=, set cost to -1
- if {tc.signdata.%location of event-block%.cost} is not set:
- stop
- set line 1 to "&6&l%line 2%"
- set line 2 to ""
- updateSign(location of event-block, event-block)
- on right click on sign:
- if {tc.signdata.%location of event-block%.cost} is not set:
- stop
- else if {tc.signdata.%location of event-block%.level} >= {tc.signdata.%location of event-block%.maxLevel}:
- play sound "entity.item.break" to player
- else if {tc.%uuid of player%.balance} < {tc.signdata.%location of event-block%.cost}:
- play sound "entity.item.break" to player
- else:
- remove {tc.signdata.%location of event-block%.cost} from {tc.%uuid of player%.balance}
- play sound "entity.player.levelup" to player
- updateSignVariables(location of event-block)
- updateSign(location of event-block, event-block)
- on break of sign:
- if {tc.signdata.%location of event-block%.cost} is set:
- delete {tc.signdata.%location of event-block%.cost}
- delete {tc.signdata.%location of event-block%.costIncrease}
- delete {tc.signdata.%location of event-block%.level}
- delete {tc.signdata.%location of event-block%.maxLevel}
Advertisement
Add Comment
Please, Sign In to add comment