on place of hay block:
if player's tool is 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::%location of event-block%} to uuid of player
if {gens::%player's uuid%} < 10:
set {Ownblocks::%event-block's location%} to event-player
add 1 to {gens::%player's uuid%}
play sound "block.note_block.pling" at volume 1 at pitch 2 to player
make 10 of poof at event-block
while event-block is hay block:
wait 80 ticks
drop 1 wheat named "&e&lWheat" with lore "&7-----&8-----" and "&eWorth 10⛃" and "&7-----&8-----" above location of event-block
else:
send "" to player
send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&710" to player
send "" to player
cancel event
on break of hay block:
if {Ownblocks::%event-block's location%} is not event-player:
send "&cSorry, that is not your gen. You cannot break it."
cancel event
else if {Ownblocks::%event-block's location%} is event-player:
set {Ownblocks::%event-block's location%} to false
set {gens::%location of event-block%} to location of event-block
remove 1 from {gens::%player's uuid%}
set event-block to air
play sound "block.note_block.pling" at volume 1 at pitch 1 to player
make 10 of poof above event-block
give player hay block named "&e&lWheat Gen" with lore "&7-----&8-----" and "&7Produces wheat every 10 seconds" and "&7Upgrade cost: &e500⛃" and "&7-----&8-----"
This should be enough of the code, I've tried to use Ownblocks as I found that on another forum post, but it's not working can anyone help?
if player's tool is 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::%location of event-block%} to uuid of player
if {gens::%player's uuid%} < 10:
set {Ownblocks::%event-block's location%} to event-player
add 1 to {gens::%player's uuid%}
play sound "block.note_block.pling" at volume 1 at pitch 2 to player
make 10 of poof at event-block
while event-block is hay block:
wait 80 ticks
drop 1 wheat named "&e&lWheat" with lore "&7-----&8-----" and "&eWorth 10⛃" and "&7-----&8-----" above location of event-block
else:
send "" to player
send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&710" to player
send "" to player
cancel event
on break of hay block:
if {Ownblocks::%event-block's location%} is not event-player:
send "&cSorry, that is not your gen. You cannot break it."
cancel event
else if {Ownblocks::%event-block's location%} is event-player:
set {Ownblocks::%event-block's location%} to false
set {gens::%location of event-block%} to location of event-block
remove 1 from {gens::%player's uuid%}
set event-block to air
play sound "block.note_block.pling" at volume 1 at pitch 1 to player
make 10 of poof above event-block
give player hay block named "&e&lWheat Gen" with lore "&7-----&8-----" and "&7Produces wheat every 10 seconds" and "&7Upgrade cost: &e500⛃" and "&7-----&8-----"
This should be enough of the code, I've tried to use Ownblocks as I found that on another forum post, but it's not working can anyone help?