And this was my 10 hours one I DID
on load: set {gens::wheat} to hay block named "&e&1Wheat gen" with lore "&7----- "&8-----" and "&7Produces wheat every 10 seconds" and "&7Upgrade cost: &e500
set {gens::coal} to coal block named "&e&8Coal gen" with lore "&7-----&8-----" and &7Produces coal every 10 seconds" and "&7Upgrade cost : &e1000
set {items :: wheat} to wheat named "&ewheat" with lore &7-----&8-----" andd "&sell 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 "&cInvailid Arguments! Usage: /givegen <gen?"
on place:
if a player's tool is block:hay
placeGen("Wheat", player, event-block's Location)
if a player's tool is block:coal
placeGen("coal", player, event-block's Location)
function placeGen{n: Text, P: player, I: location)
if {usedslots::%{_p}'s uuid%}} = {msxslots::%[_p]'s uuid%]:
send action bar "&8* &cGen cap reached! &7)&e%{usedsslots::%{_p}'s uuid%}%&7)" to {_p}
play sound "entity.villager.no" at volume 1 at pitch 1 to {_p}
set block at {_1} to air
give {_p} {gens::%{_n}%}
else:
add {_1}'s location to {gensplaced::%{_n}%{_P}'s uuid%::*}
add 1 to {usedplaced::%{_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 proof at {_1}
on left click:
--------- breakgen)"wheat", player, event block's-location)
function breakgen{n: text, p: player, I: location):
remove 1 rom {usedslots::%{_p}'s uuid%::*}
remove {_1}'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 proof at {_1}
give {_p} {gens::%{_n}%}
set block at {_1} to air
every 10 seconds:
loop all player:
Loop all blocks in radius 30 around loop-player:
if {gensplaced:: wheat::&1Loop-player's uuid%::* contains loop-block's location:
set {_ioc to block above loop-value-2
drop 1 of {items::wheat} 1 meters above {_ioc} without velocity
if {gensplaced::coal::%loop-player's uuid%;;*} contains loop-block's location:
{_ioc} to block above loop-value-2
drop 1 of {items::coal} 1 meters setabove {_ioc} without velocity
{_ioc} to block above loop-value-2
drop 1 of {items::coal} 1 meters setabove {_ioc} 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 wheat 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.amour" 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%}%&7/&e%{maxslots::%loop-player's uuid%
On right click:
if clicked-block is set:
player is sneaking
if click::%clicked-block is hay block:
[upgrade player's uuid%} is false
set {upgradeclicks::%player's uuid%} to true
wait 1 tick
remove clicked block's location from {gensplaced::Wheat::%player's uuid%::*}
add clicked block's location from {gensplaced::coal::%player's uuid%::*}
set clicked block to coal block
send title "&e&1Upgraded" with subtitle "&7Wheat -> to player
wait 0.5 seconds
set {upgradeclick::%player's uuid% to false
stop
if click::%clicked-block is hay block:
[upgrade player's uuid%} is false
set {upgradeclicks::%player's uuid%} to true
wait 1 tick
remove clicked block's location from {gensplaced::Wheat::%player's uuid%::*}
add clicked block's location from {gensplaced::coal::%player's uuid%::*}
set clicked block to coal block
send title "not coded yet" with subtitle "&7Wheat -> ?" 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
excute 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 {upgradeclicks::%player's uuid%} to false
if {coins::%player's uuid%} is not set
set {coins::%player's uuid% to 0
if {usedlots::%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 26