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 our 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.

Solved Local effects -> return boolean (true/false)

Discussion in 'Skript' started by Lystx, Nov 29, 2019.

  1. Lystx

    Lystx Member

    Joined:
    Jul 4, 2019
    Messages:
    3
    Likes Received:
    0
    Hey,
    I was wondering if it is possible to create my own permissionsystem in skript.
    But i dont want to write 'if {perms::%uuid of player%::*} contains <text>'. So I thought of a local effect

    I began like:

    local effect if %player% (has|have) permission %text%:
    set {_p} to expression-1
    set {_perm} to expression-2
    set {_uuid} to {_p}'s uuid
    if {perms::%{_uuid}%::*} contains {_perm}:
    return true
    else:
    return false



    But it didnt work. Is this possible? Can any1 help me pls?

    Greetings from Germany :emoji_slight_smile:


     
  2. Best Answer:
    Post #3 by Mastriel, Dec 15, 2019
  3. ZeyKra_

    ZeyKra_ Active Member

    Joined:
    Dec 12, 2019
    Messages:
    29
    Likes Received:
    1
    I know you don't wont but i think you must stay with this

    Code (Text):
    1. if {perms::%uuid of player%::*} contains <text>
     
  4. Mastriel

    Mastriel Member

    Joined:
    Dec 1, 2019
    Messages:
    5
    Likes Received:
    0
    Shouldn't you use a condition instead of a local effect?
     
  5. Lystx

    Lystx Member

    Joined:
    Jul 4, 2019
    Messages:
    3
    Likes Received:
    0
    Now I know how to do it:

    Code (Text):
    1. expression if %player% has permission %text%:
    2.     return type: boolean
    3.     get:
    4.         set {_p} to expr-1
    5.         set {_perm} to expr-2
    6.         if {PERMS::%{_p}%} contains {_perm}:
    7.             return true
    8.         else:  
    9.             return false
    10.    
     
Loading...