skript-mirror custom effects and expressions

  • 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.
Feb 4, 2017
71
4
1
36
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_language.skript:
expression last permissioncheck %offline player%:
        get:
                return {permissioncheck}
        set:
                set {permissioncheck} to change value
        delete:
                delete {permissioncheck}

effect permissioncheck %offline player%:
        trigger:
                if expr-1.getLastPlayed() is 0:
                        set permissioncheck expr-1 to "Unknown"
                        stop
                else:
                        delay the effect
                        set {_api} to LuckPerms.getApi()
                        set {_uuid} to {_p}.getUniqueId()
                        {_api}.getUserManager().loadUser({_uuid})
                        loop 10 times:
                                wait 1 tick
                                {_api}.getUserManager().isLoaded({_uuid}) is true
                                stop loop
                        set permissioncheck expr-1 to "%{_u}.getPermissions()%"
                        continue
                        send "%permissioncheck%" to ops

command /test <offline player>:
        permission: *
        trigger:
                permissioncheck arg-1
                last delay example
                send "%last permissioncheck arg-1%"
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:
 
Status
Not open for further replies.