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.

getter for WorldGuard flags - Via Skript-reflect

Discussion in 'Skript' started by zahrajsi.net, May 17, 2022.

Thread Status:
Not open for further replies.
  1. zahrajsi.net

    Supporter

    Joined:
    Apr 22, 2022
    Messages:
    1
    Likes Received:
    0
    Mc Version : git-Purpur-1613 (MC: 1.18.2)
    Skript ver: 2.6.1

    hello I have a problem with this code, no matter what I do it still gives me the same error, I would like to make a snipset out of it but at the moment I can't move on either way,

    what exactly is it supposed to do?

    Returning a flag value for example the flag status "pvp" and it will return "deny or allow" or "true or false"

    Thank you so much for the help..
    I'm already desperate.
    The code
    Code (Text):
    1. import:
    2.     org.bukkit.Bukkit
    3.     com.sk89q.worldguard.bukkit.WorldGuardPlugin
    4.     com.sk89q.worldguard.util.Enums
    5. on load:
    6.     set {world} to "main" parsed as world
    7.  
    8. command 333:
    9.     trigger:
    10.         set {loc} to new Location({world}, 10, 64, 100)
    11.         set {_container} to (class "com.sk89q.worldguard.WorldGuard").getInstance().getPlatform().getRegionContainer()
    12.         broadcast "&cDebug[CONTAINER]: &e%{_container}%"
    13.         set {_query} to {_container}.createQuery()
    14.         broadcast "&cDebug[emptyQuery]: &e%{_query}%"
    15.  
    16.         broadcast "&cDebug: &e%{_query}.testState({loc}, player, Flags.PVP)%"
    17.  
    18. function wgFlag(flag: string, region: string, s: sender) :: string:
    19.     set {result} to {query}.testState({_region}, {_s}, Enum.valueOf(Flags.%{_flag}%))
    20.     if {result} is "allow":
    21.         return "allow"
    22.     else:
    23.         return "deny"

    Error
     
    #1 zahrajsi.net, May 17, 2022
    Last edited: May 17, 2022
Thread Status:
Not open for further replies.

Share This Page

Loading...