Offline player balance not possible?

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

Gerlif

New Member
Apr 23, 2017
8
0
0
31
Hey, is it really not possible to grab the balance of offline players with Skript? (from Vault).

I mean, I can do /bal <playername>, just fine ingame and get the balance printed.
But whenever I do anything with Skript, even parsing as offline player, it just returns "<none>", unless the player is online.

Is there anything I can do?
 
Which version of Spigot are you using?
And which version of Skript?
(Please don't say latest)
Spigot 1.13.2
Skript 2.3-beta1

I actually managed to "solve" this issue with help from Blitz and KingAlterIV on the skUnity Discord.
We did have to dig in and use skript-mirror to import a new expression:
code_language.skript:
import:
    ch.njol.skript.hooks.VaultHook
    
expression offline balance of %offlineplayer%:
    return type: number
    get:
        return VaultHook.economy!.getBalance(expr-1)

This allowed me to get offline balance of offline players :emoji_slight_smile:
I'm not sure why this is not supported in Skript otherwise.

If anyone else want to do this, just drop the skript-mirror jar in your plugin folder, and copy-paste the code above into the top of your .sk.
 
Status
Not open for further replies.