Allowing item to only be rightclicked in specific WG region?

  • 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.
Oct 8, 2017
1
0
0
29
Can someone explain to me where my error is? I'm trying to get it so people can only use a tripwire with the name &6&LCrate Key in a region named crateroom, as opposed to just anywhere which it currently allows.

Here is what I've tested so far.
code_language.skript:
on rightclick:
    if player is holding tripwire named "&6&lCrate Key":
        set {_regions} to "%regions at player%"
        if {_regions} contains "crateroom":
            allow
        else:
            deny
            message "You have to be in a Crate Room to use your Crate Key!"
 
Should work (Haven't tested it)
Code:
on rightclick:
    If player is holding a tripwire named "&6&lCrate Key":
        If region of player contains "crateroom":
            #DO STUFF
        Else:
            Send "You have to be in the Crate Room to use your Crate Key!"
 
Status
Not open for further replies.