1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

region contains

Discussion in 'Skript' started by Kiri, Apr 14, 2017.

Thread Status:
Not open for further replies.
  1. Kiri

    Kiri Active Member

    Joined:
    Jan 28, 2017
    Messages:
    54
    Likes Received:
    2
    When I check to see if region contains something, all the region that contains that variable is triggered, would there be any work around this?

    Ex: "%region at player%" contains "122" would not only check if player is in region 122 but regions like h122
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    yes?
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Code (Skript):
    1. if "%region at player%" contains "122":
    2.   if "%region at player%" contains "H":
    3.     stop
    4.  
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    doesn't necessarily work since h is contained in other regions
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Can you describe what you want to achieve? I don't really get it.
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Basically check if the player is in region "112" without involving other regions that have "112" in them.
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    just do

    if "%region at player%" is "112"


    ???
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Tried that but is doesn't seem to work with multiple regions in place
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    You'll have to do all the exceptions as I said first.

    Example:

    You have in your server the region 112, 112a, 112b, 112c and 112d.

    If you want the skript to work only in 112, but not on A B C and D, you'll need to manually add an exception on such regions.

    Code (Skript):
    1. if "%region at player%" contains "122":
    2.   if "%region at player%" contains "112a" or "112b" or "112c" or "112d" :
    3.     stop
    4.   #do stuff
    5.   #this part will be only triggered to region 112, but not region 112 a or b or c or d.

    You're having the same issue as I am with word detection:


    https://forums.skunity.com/threads/word-detection.3245/
     
Thread Status:
Not open for further replies.

Share This Page

Loading...