Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &6&lMunchy.online &8»&7
- on join:
- if {reset::%player%} is not set:
- delete {max::%player%}
- delete {place::%player%}
- delete {block::%player%}
- delete {otherblock::%player%}
- delete {otherblock2::%player%}
- delete {playerblock::%player%}
- delete {genowner::%player%}
- delete {generator::%player%}
- set {reset::%player%} to "reset"
- set {gens::max::%uuid of player%} to 2
- set {gens::%uuid of player%} to 0
- else:
- stop
- on load:
- set {gentypes::prices::*} to 500, 1500, 4000, 15000, 30000, 50000, 75000, 125000, and 200000
- set {gentypes::cash::*} to 1, 3, 5, 7, 10, 12, 14, 16, 18, and 20
- set {gentypes::glass::*} to white stained glass, cyan stained glass, light blue stained glass, blue stained glass, green stained glass, lime stained glass, magenta stained glass, red stained glass, orange stained glass, and yellow stained glass
- on place:
- if {gens::%uuid of player%} < {gens::max::%uuid of player%}:
- if {gentypes::glass::*} contains event-block:
- loop {gentypes::glass::*}:
- if loop-value is event-block:
- add {gentypes::cash::%loop-index parsed as integer%} to {income::%uuid of player%}
- add 1 to {gens::%uuid of player%}
- set {gens::loc::%location of event-block%} to player
- set {gens::level::%location of event-block%} to 1
- else:
- cancel event
- send "{@prefix} You've reached your maximum generators!"
- on right click:
- if {gentypes::glass::*} contains event-block:
- loop {gentypes::glass::*}:
- if loop-value is event-block:
- set {_loc} to event-location
- set {_p} to player
- set {_u} to uuid of player
- set {_p2} to {gens::loc::%{_loc}%}
- set {_u2} to uuid of {gens::loc::%{_loc}%}
- set {_loopval} to loop-value
- set {_loopind} to loop-index parsed as integer
- set {_loopind1} to "%loop-index%" parsed as integer+1
- set {_block} to event-block
- if {gens::loc::%event-location%} is player:
- open virtual chest inventory with size 3 named "&8Generator" to player
- format gui slot 15 of player with red stained glass named "&cPick up Gen" to close:
- removeblock(player, {_p2}, {_loc})
- format gui slot 11 of player with green stained glass named "&aUpgrade Gen" with lore "&7Cost: &a$%{gentypes::prices::%loop-index%}%" to close:
- if player's balance >= {gentypes::prices::%{_loopind}%}:
- if {gentypes::glass::%{_loopind1}%} is set:
- add {gentypes::cash::%{_loopind1}%} to {income::%{_u}%}
- remove {gentypes::cash::%{_loopind}%} from {income::%{_u}%}
- set block at {_loc} to {gentypes::glass::%{_loopind1}%}
- subtract {gentypes::prices::%loop-index%} from player's balance
- send "{@prefix} You've upgraded your generator!"
- else:
- send "{@prefix} Your generator has reached the maximum upgrade!"
- else:
- close player's inventory
- send "{@prefix} You don't have &a$%{gentypes::prices::%{_loopind}%}% &7for an upgrade!"
- else:
- open virtual chest inventory with size 1 named "&8Generator" to player
- format gui slot 4 of player with red stained glass named "&cSteal Gen!" to close:
- removeblock(player, {_p2}, {_loc})
- function removeblock(p1: player, p2: player, loc: location):
- set {_u2} to uuid of {_p2}
- loop {gentypes::glass::*}:
- if loop-value = block at {_loc}:
- give {_p1} 1 of block at {_loc}
- remove 1 from {gens::%{_u2}%}
- remove {gentypes::cash::%loop-index%} from {income::%{_u2}%}
- delete {gens::loc::%{_loc}%}
- delete {gens::level::%{_loc}%}
- set block at {_loc} to air
- every 3 seconds:
- loop all players:
- add {income::%uuid of loop-player%} to loop-player's balance
- set action bar of loop-player to "&7[&a+%{income::%uuid of loop-player%}%&7]"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement