Can't Specify Which Block Clicked

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

    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.

Arthyn

Member
Feb 15, 2021
2
0
1
Hello, I've been trying to get a small key system to work smoothly but I keep running into this problem: I am unable to specify which block has to be clicked in order for the key to work. Currently the key will teleport the player to a location tied to the key regardless of which emerald block it is. It would make things a thousand times easier if I could specify the block. I am sorry if it's a dumb question or anything.

How it works right now:
Code:
on rightclick on emerald block:
    if player is not holding emerald or nether star or blaze rod or nether quartz:
        send "&c&oYou require a Dungeon Key to enter." to player

on rightclick on emerald block:
    if player is holding emerald named "Emerald Key":
        teleport player to location at -106531, 110, 61700 in world "DIM100"
        remove emerald named "Emerald Key" from player's inventory
    
on rightclick on emerald block:
    if player is holding nether star named "Star Key":
        teleport player to location at -106531, 110, 61700 in world "DIM100"
        remove nether star named "Star Key" from player's inventory

This is the code that I have been trying things out with, I do have to say that I run on an older version because I am using this on a server with some mods:
Code:
on rightclick on emerald block:
    if event-block's location is 12698, 88, 5054 in world "DIM100":
        send "Succes" to player
 
Status
Not open for further replies.