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.

skript-mirror custom effects and expressions

Discussion in 'Skript' started by mel_instagibson, Dec 14, 2018.

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

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    Does someone know how to fix this? i need a function that does a database lookup for a given player and returns a string but i cant use normal functions for it since they dont allow a delay.
    im trying with skript-mirror but there is no documentation or examples that go past 2-liners
    Code (Skript):
    1.  
    2. expression last permissioncheck %offline player%:
    3.         get:
    4.                 return {permissioncheck}
    5.         set:
    6.                 set {permissioncheck} to change value
    7.         delete:
    8.                 delete {permissioncheck}
    9.  
    10. effect permissioncheck %offline player%:
    11.         trigger:
    12.                 if expr-1.getLastPlayed() is 0:
    13.                         set permissioncheck expr-1 to "Unknown"
    14.                         stop
    15.                 else:
    16.                         delay the effect
    17.                         set {_api} to LuckPerms.getApi()
    18.                         set {_uuid} to {_p}.getUniqueId()
    19.                         {_api}.getUserManager().loadUser({_uuid})
    20.                         loop 10 times:
    21.                                 wait 1 tick
    22.                                 {_api}.getUserManager().isLoaded({_uuid}) is true
    23.                                 stop loop
    24.                         set permissioncheck expr-1 to "%{_u}.getPermissions()%"
    25.                         continue
    26.                         send "%permissioncheck%" to ops
    27.  
    28. command /test <offline player>:
    29.         permission: *
    30.         trigger:
    31.                 permissioncheck arg-1
    32.                 last delay example
    33.                 send "%last permissioncheck arg-1%"
    34.  
    I know this cant work, cant even explain where the effect would get the expr-1 from but thats the best i could stitch together with what i found :emoji_frowning:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...