Creative+ Offline variable handler

Hayden

Member
Joined
May 19, 2023
Messages
34
It's a shame no one knows how to do it, when it is so easy. It is basically the reverse of the Tab prefix blocking method.


YAML:
On join:
    if entity with name of player exists:
        delete entity
on quit:
    create entity with name of player

# example:
Command /setvar [<text>] [<text>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "No player mentioned."
        else:
            select entity named "%arg-1%"
                set {%arg-2%::%entity%} to "%arg-3%"
That is in basic Skript syntax, which follows java like mineland. And it is easier to view. This is to be translated to mineland. Proper skript will be below:

YAML:
on join:
    set {uuid::%player%} to player's uuid
    set {joined::%{uuid::%player%}%} to "true"
command /setplayervar [<text>] [<text>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "Arg-1, arg-2, and arg-3 not set"
        else:
            if arg-2 is not set:
                send "Arg-2 and arg-3 not set"
            else:
                if {%arg-1%::%arg-2%} is not set:
                    send "Variable doesn't exist, creating new one"
                if arg-3 is not set:
                    delete {%arg-1%::%arg-2%}
                    send "Deleted variable"
                else:
                    set {%arg-1%::%arg-2%} to %arg-3%

Because this is in skript, it doesn't care if the player is online or not, due to it not needing to run selections.
 
Last edited:

deefer

Active member
Joined
May 22, 2023
Messages
458
simple explanation: just use an entity and kill it then spawn it back
 

Hayden

Member
Joined
May 19, 2023
Messages
34
simple explanation: just use an entity and kill it then spawn it back
Yes, but I wanted to give a more code-like explanation, since skript follows java like mineland does, and has similar parsing, functions etc, I use skript
 
Top