Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #skbee
- on load:
- set {gens::wheat} to hay block named "&e&lWheat Gen" with lore "&7-----&8-----" and "&7Produces wheat every 10 seconds" and "&7Upgrade cost: &e500⛃" and "&7-----&8-----"
- set {gens::coal} to coal block named "&8&lCoal Gen" with lore "&7-----&8-----" and "&7Produces coal every 10 seconds" and "&7Upgrade cost: &e1000⛃" and "&7-----&8-----"
- set {items::wheat} to wheat named "&eWheat" with lore "&7-----&8-----" and "&7Sell Price: &e10⛃" and "&7-----&8-----"
- set {items::coal} to coal named "&8Coal" with lore "&7-----&8-----" and "&7Sell Price: &e20⛃" and "&7-----&8-----"
- command /givegen [<text>]:
- permission: op
- trigger:
- if arg-1 is set:
- give player {gens::%arg-1%}
- else:
- message "&cInvalid Arguments! Usage: /givegen <gen>"
- on place:
- if player's tool is hay block:
- placeGen("Wheat", player, event-block's location)
- if player's tool is coal block:
- placeGen("Coal", player, event-block's location)
- on left click:
- if event-block is hay block:
- breakGen("Wheat", player, event-block's location)
- if event-block is coal block:
- breakGen("Coal", player, event-block's location)
- function placeGen(n: text, p: player, l: location):
- if {usedslots::%{_p}'s uuid%} = {maxslots::%{_p}'s uuid%}:
- send action bar "&8* &cGen cap reached! &7(&e%{usedslots::%{_p}'s uuid%}%&7/&e%{maxslots::%{_p}'s uuid%}%&7)" to {_p}
- play sound "entity.villager.no" at volume 1 at pitch 1 to {_p}
- set block at {_l} to air
- give {_p} {gens::%{_n}%}
- else:
- add {_l}'s location to {gensplaced::%{_n}%::%{_p}'s uuid%::*}
- add 1 to {usedslots::%{_p}'s uuid%}
- send action bar "&8* &7Placed a &e%{_n}% Gen &7(&e%{usedslots::%{_p}'s uuid%}%&7/&e%{maxslots::%{_p}'s uuid%}%&7)" to {_p}
- play sound "block.note_block.pling" at volume 1 at pitch 2 to {_p}
- make 10 of poof at {_l}
- function breakGen(n: text, p: player, l: location):
- remove 1 from {usedslots::%{_p}'s uuid%}
- remove {_l}'s location from {gensplaced::%{_n}%::%{_p}'s uuid%::*}
- send action bar "&8* &7Picked up a &e%{_n}% Gen &7(&e%{usedslots::%{_p}'s uuid%}%&7/&e%{maxslots::%{_p}'s uuid%}%&7)" to {_p}
- play sound "block.note_block.pling" at volume 1 at pitch 1 to {_p}
- make 10 of poof at {_l}
- give {_p} {gens::%{_n}%}
- set block at {_l} to air
- every 10 seconds:
- loop all players:
- loop all blocks in radius 30 around loop-player:
- if {gensplaced::Wheat::%loop-player's uuid%::*} contains loop-block's location:
- set {_loc} to block above loop-value-2
- drop 1 of {items::wheat} 1 meters above {_loc} without velocity
- if {gensplaced::Coal::%loop-player's uuid%::*} contains loop-block's location:
- set {_loc} to block above loop-value-2
- drop 1 of {items::coal} 1 meters above {_loc} without velocity
- command /sell:
- trigger:
- set {_total} to 0
- set {_wheatamt} to amount of wheat in player's inventory
- remove all wheat from player's inventory
- add {_wheatamt} * 10 to {_total}
- set {_coalamt} to amount of coal in player's inventory
- remove all coal from player's inventory
- add {_coalamt} * 20 to {_total}
- add {_total} to {coins::%player's uuid%}
- send title "&7Sale Summary:" with subtitle "&e+%{_total}%⛃" for 5 seconds
- play sound "entity.horse.armor" at volume 1 at pitch 1 to player
- every 2 seconds:
- loop all players:
- send action bar "&e%{coins::%loop-player's uuid%}%⛃ &7Gen Slots: &e%{usedslots::%loop-player's uuid%}%&7/&e%{maxslots::%loop-player's uuid%}%" to loop-player
- on right click:
- if clicked block is set:
- player is sneaking
- if clicked block is hay block:
- {upgradeclick::%player's uuid%} is false
- set {upgradeclick::%player's uuid%} to true
- wait 1 tick
- remove clicked block's location from {gensplaced::Wheat::%player's uuid%::*}
- add clicked block's location to {gensplaced::Coal::%player's uuid%::*}
- set clicked block to coal block
- send title "&e&lUpgraded" with subtitle "&7Wheat -> Coal" to player
- wait 0.5 seconds
- set {upgradeclick::%player's uuid%} to false
- stop
- if clicked block is coal block:
- {upgradeclick::%player's uuid%} is false
- set {upgradeclick::%player's uuid%} to true
- wait 1 tick
- send title "&c&lNot Coded Yet" with subtitle "&7Coal -> ?" to player
- wait 0.5 seconds
- set {upgradeclick::%player's uuid%} to false
- stop
- command /start:
- trigger:
- if {start::%player's uuid%} is not true:
- set {start::%player's uuid%} to true
- execute player command "/p auto"
- give player {gens::Wheat}
- wait 1 second
- send title "&ePlace your gen to begin!" with subtitle " " to player for 3 seconds
- on join:
- set {upgradeclick::%player's uuid%} to false
- if {coins::%player's uuid%} is not set:
- set {coins::%player's uuid%} to 0
- if {usedslots::%player's uuid%} is not set:
- set {usedslots::%player's uuid%} to 0
- if {maxslots::%player's uuid%} is not set:
- set {maxslots::%player's uuid%} to 10
Add Comment
Please, Sign In to add comment