Help with postions of blocks

  • 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!

Status
Not open for further replies.

BoxMiners

Member
Jul 19, 2022
47
0
6
18
Code:
on right click on sign:
    if block's location is 186, 5, -19, world "shop":
        if player's held item contains "axe" or "Shovel" or "Axe":
            if {money.%player%} is less than 20000:
                send "{@shop} {@notenough}"
                stop
            else:
                enchant player's tool with efficiency 5
                remove 20000 from {money.%player%}
                send "{@shop} {@sbought} efficiency 5 on your tools" 
        else:
            send "{@shop} &cError! You're holding the wrong tool for this enchant"

Thats the code, it doesnt show errors, i think its the location of the block
nothing really happends when i rightclick on it, if anyone have a solution please help me
 
most likely you need to use .5 behind the location of a block but to be completely sure just debug by checking the location of every sign you right click and set the location to that like this:

Code:
on right click on sign:
    broadcast event-location
 
  • Like
Reactions: Zhync
Comparing locations in Skript is very specific, so the syntax also isn't too flexible.
You'll need to specific with what location you're checking.

You can use the location() function in this case. This example would look like:
Code:
if block's location is location(186, 5, -19, world "shop")
# or you could use:
if location of block is location(186, 5, -19, world "shop")

I hope this helps, please reply or send me a message if you have any questions!
 
Status
Not open for further replies.