I am trying to make a skript that you can place a player head (block miner) and it breaks blocks around it, has a menu, ect. But I keep getting errors, is there something I am doing wrong? (I am too lazy to write all the errors, I can share if you need though)
Code:
variables:
{oakminer::count::%player%} = 0
{oakminer::location::*} = {} # Stores all miner locations
{oakminer::owner::%location%} = {} # Stores the owner of each miner by specific location
on place of player head:
if name of player's tool is "&8B5A2B&lO&926436&la&986E41&lk &9F774B&lM&A68156&li&AD8B61&ln&B3956C&le&BA9F77&lr &C1A982&l[&C8B28C&lT&CEBC97&l1&D5C6A2&l]":
set {_loc} to location of event-block
add 1 to y-coordinate of {_loc}
set event-block to air
set block at {_loc} to player's tool
add {_loc} to {oakminer::location::*}
set {oakminer::owner::%{_loc}%} to player
add 1 to {oakminer::count::%player%}
send "&aOak Miner [T1] has been placed." to player
every 0.5 seconds:
loop {oakminer::location::*}:
set {_miner} to loop-value
set {_block} to a random block within radius 5 around {_miner} where block type is oak log
if {_block} is not air:
set {_drop} to {_block}
set {_block} to air
drop 1 of {_drop} at location of {_block}
on right click on player head:
set {_loc} to location of target block
if {oakminer::owner::%{_loc}%} is not player:
send "&cThis is not your block miner." to player
else:
open chest with 1 row named "&8Oak Miner Menu" to player
format slot 0 of player's current inventory with barrier named "&cDelete Miner" to close then run:
delete {oakminer::owner::%{_loc}%}
remove {_loc} from {oakminer::location::*}
remove 1 from {oakminer::count::%player%}
send "&aMiner deleted successfully." to player
format slot 1 of player's current inventory with player head named "&eRemove Miner" to close then run:
if player's inventory is full:
send "&cYour inventory is full!" to player
else:
give player 1 of player's tool
delete {oakminer::owner::%{_loc}%}
remove {_loc} from {oakminer::location::*}
remove 1 from {oakminer::count::%player%}
send "&aMiner removed and returned to inventory." to player
format slot 2 of player's current inventory with compass named "&6Move Miner" to close then run:
send "&eRight-click to set new location or left-click to cancel." to player
set {oakminer::move::%player%} to {_loc}
on right click:
if {oakminer::move::%player%} is set:
set {_newloc} to location of event-block
add 1 to y-coordinate of {_newloc}
set block at {oakminer::move::%player%} to air
set block at {_newloc} to player's tool
delete {oakminer::owner::%{oakminer::move::%player%}}
remove {oakminer::move::%player%} from {oakminer::location::*}
add {_newloc} to {oakminer::location::*}
set {oakminer::owner::%{_newloc}%} to player
send "&aMiner moved successfully to new location." to player
delete {oakminer::move::%player%}
on left click:
if {oakminer::move::%player%} is set:
send "&cMove aborted." to player
delete {oakminer::move::%player%}