Need help with block break

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Jun 23, 2023
32
0
6
30
command /sethack farmlands:
trigger:
if player has permission "tas.admin":
if targeted block is light blue stained glass:
if {farmland::%location of targeted block%} is not set:

set {_loc} to location of targeted block

set {farmland::%{_loc}%} to {_loc}

message "&7Inserting hacking module."
else:
message "&e&l(!)&7 Command not found."

on break of light blue stained glass:
if location of event block = {farmland::%{_loc}%}
cancel event
message "&7Inserting hacking module."
this is supposed to detect the block break in that coordinate
 
this is supposed to detect the block break in that coordinate
Your issue is the type of variable you use. Specifically the {_loc} one. Since it's a local variable, it won't save that info outside of the code that it's used for. To fix this I would recommend looking into the different types of variables that Skript offers and deciding which one would be best for your code.
 
Your issue is the type of variable you use. Specifically the {_loc} one. Since it's a local variable, it won't save that info outside of the code that it's used for. To fix this I would recommend looking into the different types of variables that Skript offers and deciding which one would be best for your code.
now made it global but still doesnt work