So I am trying to make a gen binding skript to make it so when you place a minion (oak log) you get a stick, which then you right click stone to make the minion auto mine the stone for you. code:
on first join:
make player execute command "/p auto"
give player 1 stone named "&7Stone Generator"
on load:
delete {generators::*}
delete {minions::*}
add "&7Stone Generator" to {generators::*}
add "&6Minion" to {minions::*}
if {bindedminion.%player's uuid%} is not set:
set {bindedminion.%player's uuid%} to 1
on place of stone:
if name of event-item is "&7Stone Generator":
add location of event-block to {stonegenplaced.%player's uuid%::*}
play sound "block.note_block.pling" at volume 1 at pitch 2 to player
on mine:
if player is not sneaking:
if event-block is stone:
cancel event
set location of event-block to {stonelocation1}
give event-block to player
set {block1} to stone
set event-block to bedrock
wait 69 ticks
set event-block to {block1}
if player is sneaking:
if event-block is stone:
cancel drops
give player 1 stone named "&7Stone Generator"
#------------MINION
on place of oak log:
give player a stick named "Minion Binder Tool"
set {bindedminion.%location%} to location of event-block
on rightclick:
if clicked block is stone:
if {binded.%location%} is not set:
if player's tool is stick named "Minion Binder Tool":
if {bindedminion.%player's uuid%} < 6:
if {bindedgen.%player's uuid%::*} is "nil":
set player's action bar to "Binded Generators: %{bindedminion.%player's uuid%}%"
add 1 to {bindedminion.%player's uuid%}
set {bindedgen.%player's uuid%::*} to clicked block's location
if {bindedgen.%player's uuid%::*} is not "nil":
send "This Gen Is Already Binded!" to player
if {bindedminion.%player's uuid%} = 5:
remove player's held item from player's inventory
command /unbind:
trigger:
set {bindedminion.%player's uuid%} to 1
on break of oak log:
if {bindedgen.%player's uuid%::*} is set:
set {bindedgen.%player's uuid%::*} to nil