Solved Help with rankup script

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

Elsmok

Member
Jul 3, 2017
25
1
0
Hey guys. So i am currently making a rankup script, but whenever i try to rank up it says i dont have enough exp. I have checked this multiple times and sorry if i am missing something very clear that is right in front of me

I am using skript verion 2.2
Code:
command /rank [<text>] [<player>] [<text>]:
    trigger:
        if args 1 is not set:
            send "&2/&arank levelup &4> Level up!"
        if args 1 is "levelup":
            if {Kitpvp.rank.%player%} is "Default":
                if {Kitpvp.exp.%player%} is more than or equal to 100:
                    set {Kitpvp.rank.%player%} to "Fighter"
                    broadcast "&a&l%player% &3&lhas levelled  up to &a&l%{Kitpvp.rank.%player%}%"
                else:
                    send "&c<!> You do not have enough exp to level"
                    send "&c<!> Your current exp is %{Kitpvp.exp.%player%}%"
 
If you want it to check the xp of arg-2, then {Kitpvp.rank.%player%} & {Kitpvp.exp.%player%} needs to be {Kitpvp.rank.%arg-2%} & {Kitpvp.exp.%arg-2%}
 
If you want it to check the xp of arg-2, then {Kitpvp.rank.%player%} & {Kitpvp.exp.%player%} needs to be {Kitpvp.rank.%arg-2%} & {Kitpvp.exp.%arg-2%}
But you are not putting anything in arg-2. the only argument you are entering is "levelup"
 
okay im not psychic, i cant magically know what youre typing and not typing in the command. i saw the player arg and thought that might be what your trying to do.

the code works for me so broadcast the variables to see if theyre what you expect them to be
 
okay im not psychic, i cant magically know what youre typing and not typing in the command. i saw the player arg and thought that might be what your trying to do.

the code works for me so broadcast the variables to see if theyre what you expect them to be
okay :emoji_confused:
 
maybe you has some overwrite at add with your xp... Look maybe again... Btw for us is more helpfull, if you post full code. because the reason of error is not there.
Code:
command /rank [<text>] [<player>] [<text>]:
    trigger:
        if args 1 is not set:
            send "&2/&arank levelup &4> Level up!"
        if args 1 is "levelup":
            if {Kitpvp.rank.%player%} is "Default":
                if {Kitpvp.exp.%player%} is more than or equal to 100:
                    set {Kitpvp.rank.%player%} to "Fighter"
                    broadcast "&a&l%player% &3&lhas levelled  up to &a&l%{Kitpvp.rank.%player%}%"
                else:
                    send "&c<!> You do not have enough exp to level"
                    send "&c<!> Your current exp is %{Kitpvp.exp.%player%}%"
        if args 1 is "stats" or "stat":
            if args 2 is not set:
                send "&7Your current rank is %{Kitpvp.rank.%player%}%" to player
                send "&7Your current exp is &a%{Kitpvp.exp.%player%}%" to player
            else:
                if args 2 is set:
                    if player has permission "kitpvp.admin":
                        send "&7%args 2%'s current rank is %{Kitpvp.rank.%args 2%}%" to player
                        send "&7%args 2%'s current exp is &a%{Kitpvp.exp.%args 2%}%" to player
 
And how do you add xp?
Code:
command /admin [<text>] [<text>] [<player>] [<text>]:
    trigger:
        if player has permission "kkit.admin":
            if args 1 is "set":
                if args 2 is "rank":
                    if args 4 is "Default", "Fighter" or "God":
                        set {Kitpvp.rank.%args 3%} to args 4
                        send "&a<!> Your rank has been set to %args 4%" to args 3          
                    else:
                        send "&c<!> That rank does not exist. Do &u/rank list &cfor a list of ranks"
                if args 2 is "exp":
                    set {Kitpvp.exp.%args 3%} to args 4
                    send "&a<!> Your exp has been set to %args 4%" to args 3
            if args 1 is "reset":
                if args 2 is "exp":
                    set {Kitpvp.exp.%args 3%} to 0
                    send "&a<!> Your exp has been reset" to args 3
sorry about that
 
i think the problem is, you saved it as text. You need parsed it as number like this

code_language.skript:
set {kitpvp.exp.%args 3%} to args 4 parsed as number
 
i think the problem is, you saved it as text. You need parsed it as number like this

code_language.skript:
set {kitpvp.exp.%args 3%} to args 4 parsed as number
Omg Thank You very Much! This was strange because when i did /rank stats it said that i had 100 exp, but oh well. Thank you again!

Kind Regards,
Elsmok
 
Status
Not open for further replies.