Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on rightclick on a barrier:
- add {APC.%player%} to {apples.%player%}
- on first join:
- set {APC.%player%} to 1
- set {APS.%player%} to 0
- set {apples.%player%} to 0
- command /upgrades [<text>]:
- trigger:
- if arg-1 is not set:
- open chest with 1 rows named "&a&lUPGRADES" to player
- wait 1 tick
- format slot 3 of player with magma cream named "&7&lAPC &a&lUPGRADES" to run [make player execute "/upgrades apc"]
- format slot 5 of player with magma cream named "&7&lAPS &a&lUPGRADES" to run [make player execute "/upgrades aps"]
- if arg-1 is "apc":
- open chest with 1 rows named "&7&lAPC &a&lUPGRADES" to player
- wait 1 tick
- format slot 0 of player with arrow named "&c&lBack" to run [make player execute "/upgrades"]
- format slot 2 of player with apple named "&2+1 &a(200 Apples)" to run [apc(1, 200, player)]
- format slot 3 of player with apple named "&2+10 &a(2,000 Apples)" to run [apc(10, 2000, player)]
- format slot 4 of player with apple named "&2+100 &a(20,000 Apples)" to run [apc(100, 20000, player)]
- format slot 5 of player with apple named "&2+1,000 &a(200,000 Apples)" to run [apc(1000, 200000, player)]
- format slot 6 of player with apple named "&2+10,000 &a(2,000,000 Apples)" to run [apc(10000, 2000000, player)]
- format slot 7 of player with apple named "&2+100,000 &a(20,000,000 Apples)" to run [apc(100000, 20000000, player)]
- format slot 8 of player with apple named "&2+1,000,000 &a(200,000,000 Apples)" to run [apc(1000000, 200000000, player)]
- if arg-1 is "aps":
- open chest with 1 rows named "&7&lAPS &a&lUPGRADES" to player
- wait 1 tick
- format slot 1 of player with arrow named "&c&lBack" to run [make player execute "/upgrades"]
- format slot 2 of player with apple named "&2+1 &a(200 Apples)" to run [aps(1, 200, player)]
- format slot 3 of player with apple named "&2+10 &a(2,000 Apples)" to run [aps(10, 2000, player)]
- format slot 4 of player with apple named "&2+100 &a(1,000,000 Apples)" to run [aps(100, 1000000, player)]
- format slot 5 of player with apple named "&2+1,000 &a(10,000,000 Apples)" to run [aps(1000, 10000000, player)]
- format slot 6 of player with apple named "&2+10,000 &a(100,000,000 Apples)" to run [aps(10000, 100000000, player)]
- format slot 7 of player with apple named "&2+100,000 &a(1,000,000,000 Apples)" to run [aps(100000, 1000000000, player)]
- format slot 8 of player with apple named "&2+1,000,000 &a(10,000,000,000 Apples)" to run [aps(1000000, 10000000000, player)]
- function apc(n: number , m: number , p: player):
- if {apples.%{_p}%} is greater than {_m} - 1:
- add {_n} to {APC.%{_p}%}
- send "&2You purchased &a+%{_n}% &2APC" to {_p}
- remove {_m} from {apples.%{_p}%}
- else if {apples.%{_p}%} is less than {_m}:
- send "&cYou don't have enough apples to purchase this! &7(%{apples.%{_p}%}%/%{_m}%)" to {_p}
- function aps(n: number , m: number , p: player):
- if {apples.%{_p}%} is greater than {_m} - 1:
- add {_n} to {APS.%{_p}%}
- send "&2You purchased &a+%{_n}% &2APS" to {_p}
- remove {_m} from {apples.%{_p}%}
- else if {apples.%{_p}%} is less than {_m}:
- send "&cYou don't have enough Apples to purchase this! &7(%{apples.%{_p}%}%/%{_m}%)" to {_p}
- command /reset <player>:
- permission: stats.reset
- trigger:
- set {apples.%arg-1%} to 0
- set {APS.%arg-1%} to 0
- set {APC.%arg-1%} to 1
- command /set <text> <player> <number>:
- permission: stats.reset
- trigger:
- if arg-1 is "apples":
- set {apples.%arg-2%} to arg-3
- if arg-1 is "aps":
- set {APS.%arg-2%} to arg-3
- if arg-1 is "apc":
- set {APC.%arg-2%} to arg-3
- every second:
- loop all players:
- if {APS.%loop-player%} is greater than 0:
- add {APS.%loop-player%} to {apples.%loop-player%}
- every tick:
- loop all players:
- set action bar of loop-player to "&4&lApples: &c%{apples.%loop-player%}% &8| &4&lAPC: &c%{APC.%loop-player%}% &8| &4&lAPS: &c%{APS.%loop-player%}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement