every 1 second: loop all players in world "tower": set {_p} to loop-player if {hastower::*} contains {_p}: set {_gps} to 1.5^{%{_p}%.towerlevel} set {_gps} to rounded down {_gps} add {_gps} to {_p}'s balance send action bar "&3Balance: &3%{_p}'s balance% &eMoney Per Second: &e%{_gps}% " to {_p} set {_p}'s hunger level to 10 set xp of {_p} to 0 set level of {_p} to {%{_p}%.towerlevel} if {%{_p}%.towerhp} is less than {%{_p}%.towerhealth}: set {_heal} to {%{_p}%.towerregen}/2 add {_heal} to {%{_p}%.towerhp} set {_p} to {_p} parsed as player set {_progress} to ({%{_p}%.towerhp}/{%{_p}%.towerhealth})*100 set {_progress} to rounded down {_progress} create bossbar titled "&b&lTower Health" and id "%{_p}%" for {_p} with progress {_progress} with colors red else: give 1 bell to loop-player on death: victim is player player's world is "tower" if damage cause is fall: cancel event set victim's health to 1 exit cancel event set victim's health to 10 teleport victim to {%victim%.towerspawn} set victim's game mode to spectator if {combatlog::*} contains victim: if attacker is a player: set {_penalty} to player's balance/10 add {_penalty} to attacker's balance subtract {_penalty} from victim's balance message "&e+&e%{_penalty}%" to the attacker message "&c-&c%{_penalty}%" to the victim set {_x} to 10 loop 10 times: send action bar "%{_x}%" to the player wait 1 seconds subtract 1 from {_x} set victim's game mode to survival teleport victim to {%victim%.towerspawn} remove victim from {combatlog::*} command /settowerlevel : permission:minecraft.op trigger: set {%arg 1%.towerlevel} to arg 2 set {%arg 1%.upgradecost} to (2^({%arg 1%.towerlevel}-1))+30*{%arg 1%.towerlevel} set {%arg 1%.upgradecost} to rounded down {%arg 1%.upgradecost} message "&eSet %arg 1%&e's level to %arg 2%" to the player command /settowerheight : permission:minecraft.op trigger: set {%arg 1%.towerheight} to arg 2 set {%arg 1%.heightupgradecost} to (1.25^({%arg 1%.towerheight}-1))+30*{%arg 1%.towerheight} set {%arg 1%.towerheight} to rounded down {%arg 1%.towerheight} message "&eSet %arg 1%&e's tower height to %arg 2%" to the player command /settowerhealth : permission:minecraft.op trigger: set {%arg 1%.towerhealth} to arg 2 set {%arg 1%.healthupgradecost} to (1.25^({%arg 1%.towerhealth}-1))+30*{%arg 1%.towerhealth} set {%arg 1%.healthupgradecost} to rounded down {%arg 1%.healthupgradecost} message "&eSet %arg 1%&e's tower health to %arg 2%" to the player command /settowerbow : permission:minecraft.op trigger: set {%arg 1%.towerbow} to arg 2 set {%arg 1%.bowupgradecost} to (1.5^({%arg 1%.towerbow}-1))+30*{%arg 1%.towerbow} set {%arg 1%.bowupgradecost} to rounded down {%arg 1%.bowupgradecost} message "&eSet %arg 1%&e's tower bow level to %arg 2%" to the player command /settowersword : permission:minecraft.op trigger: set {%arg 1%.towersword} to arg 2 set {%arg 1%.swordupgradecost} to (1.5^({%arg 1%.towersword}-1))+30*{%arg 1%.towersword} set {%arg 1%.swordupgradecost} to rounded down {%arg 1%.swordupgradecost} message "&eSet %arg 1%&e's sword level to %arg 2%" to the player message "&e it now costs &e%{%arg 1%.swordupgradecost}%" command /settowerarmor : permission:minecraft.op trigger: set {%arg 1%.towerarmor} to arg 2 set {%arg 1%.armorupgradecost} to (1.5^({%arg 1%.towerarmor}-1))+30*{%arg 1%.towerarmor} set {%arg 1%.armorupgradecost} to rounded down {%arg 1%.armorupgradecost} message "&eSet %arg 1%&e's tower armor level to %arg 2%" to the player command /settowerregen : permission:minecraft.op trigger: set {%arg 1%.towerregen} to arg 2 set {%arg 1%.regenupgradecost} to (10^({%arg 1%.towerregen})) set {%arg 1%.regenupgradecost} to rounded down {%arg 1%.regenupgradecost} message "&eSet %arg 1%&e's tower regen level to %arg 2%" to the player command /setbal : permission:minecraftop trigger: set arg 1's balance to arg 2