My ranks are resetting when server restarts

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

Hexa

Member
Jan 21, 2018
11
0
0
25
How do I save my variables? Like my variables all resetting when I restart the server.

Someone said don't use local variables but I'm already not using em.

Here's a code for you guys

code_language.skript:
command /rank [<offlineplayer>] [<text>]:
    trigger:
        if {rank::%player's uuid%} is not "Admin" or "Owner":
            send "{@p} {@np}"
            stop
        if arg-2 is set:
            if {rank::%player's uuid%} is not "Owner":
                if "%arg-1%" is "%player%":
                    send "{@p} {@np}"
                    stop
            if {rank::%player's uuid%} is not "Owner":
                if {rank::%arg-1's uuid%} is "Owner" or "Developer" or "Administrator":
                    send "{@p} {@np}"
                    stop
            if arg-2 is "Owner":
                if {rank::%player's uuid%} is not "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&4&l%arg-1%"
                    set {rank::%arg-1's uuid%} to "Owner"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Admin" or "Administrator":
                if {rank::%player's uuid%} is not "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&4&l%arg-1%"
                    set {rank::%arg-1's uuid%} to "Admin"
                    set arg-1 tab name to "%arg-1's display name%"
                    set {ranked.player} to "&4&l%arg-1%"
                    send "{@p} %{ranked.player}%&f's rank successfully changed!"
                    stop
            if arg-2 is "Developer" or "Dev":
                if {rank::%player's uuid%} is not "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    run arg-1 command "/colorname" as op
                    set {rank::%arg-1's uuid%} to "Developer"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Senior" or "Senior Moderator" or "Sr.Mod" or "Sr" or "SrMod" or "SrModerator":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&4%arg-1%"
                    set {rank::%arg-1's uuid%} to "Senior"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Mod" or "Moderator":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&c%arg-1%"
                    set {rank::%arg-1's uuid%} to "Mod"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Builder":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&d%arg-1%"
                    set {rank::%arg-1's uuid%} to "Builder"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Vip":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&5%arg-1%"
                    set {rank::%arg-1's uuid%} to "Vip"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Quantum":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&a%arg-1%"
                    set {rank::%arg-1's uuid%} to "Quantum"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Platinum":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&b%arg-1%"
                    set {rank::%arg-1's uuid%} to "Platinum"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Diamond":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&3%arg-1%"
                    set {rank::%arg-1's uuid%} to "Diamond"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Gold":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&6%arg-1%"
                    set {rank::%arg-1's uuid%} to "Gold"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            if arg-2 is "Regular" or "Member":
                if {rank::%player's uuid%} is not "Admin" or "Owner":
                    send "{@p} {@np}"
                    stop
                else:
                    set arg-1's display name to "&2%arg-1%"
                    set {rank::%arg-1's uuid%} to "Regular"
                    set arg-1 tab name to "%arg-1's display name%"
                    send "{@p} %arg-1's display name%&8'&fs rank successfully changed!"
                    stop
            else:
                if {rank::%player's uuid%} is "Admin":
                    send "{@p} &cUsage: /rank <player> &4Senior, &cMod, &dBuilder, &5Vip, &aQuantum, &bPlatinum, &3Diamond, &6Gold, &2Regular"
                    stop
                else if {rank::%player's uuid%} is "Owner":
                    send "{@p} &cUsage: /rank <player> &4&lOwner, &4&lAdmin, &4&lD&c&le&6&lv&e&le&a&ll&2&lo&b&lp&9&le&1&lr, &4Senior, &cMod, &dBuilder, &5Vip, &aQuantum, &bPlatinum, &3Diamond, &6Gold, &2Regular"
                    stop
        else:
            if {rank::%player's uuid%} is "Admin":
                send "{@p} &cUsage: /rank <player> &4Senior, &cMod, &dBuilder, &5Vip, &aQuantum, &bPlatinum, &3Diamond, &6Gold, &2Regular"
                stop
            else if {rank::%player's uuid%} is "Owner":
                send "{@p} &cUsage: /rank <player> &4&lOwner, &4&lAdmin, &4&lD&c&le&6&lv&e&le&a&ll&2&lo&b&lp&9&le&1&lr,  &4Senior, &cMod, &dBuilder, &5Vip, &aQuantum, &bPlatinum, &3Diamond, &6Gold, &2Regular"
                stop
 
seems like skript is having issues writing to the database. maybe permissions.
 
Status
Not open for further replies.