Variables not working

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

Brandawg

Member
May 8, 2017
19
0
1
23
So I have this skript and when you mine a coal block you should get 1 custom xp that I created. But when I do /xp which tells me how much custom xp I have it says 0 any help?
code_language.skript:
variables:
    {xp} = 0
    {level} = 0
on login:
    if {xp::%player%} is not set:
        set {xp::%player%} to 0
    if {level::%player%} is not set:
        set {level::%player%} to 0
on break:       
    if event-block is coal ore:
        add 1 coal ore to player
        add 1 to {xp::%player%}
        cancel event
        set event-block to stone
        wait 2 seconds
        set event-block to coal ore         
    if event-block is iron ore:
        add 1 iron ore to player
        cancel event
        set event-block to stone
        wait 3 seconds
        set event-block to coal ore               
    if event-block is lapis ore:
        add 1 lapis ore to player
        cancel event
        set event-block to stone
        wait 4 seconds
        set event-block to lapis ore
    if event-block is redstone ore:
        add 1 redstone ore to player
        cancel event
        set event-block to stone
        wait 5 seconds
        set event-block to redstone ore
    if event-block is gold ore:
        add 1 gold ore to player
        cancel event
        set event-block to stone
        wait 6 seconds
        set event-block to gold ore
    if event-block is diamond ore:
        add 1 diamond ore to player
        cancel event
        set event-block to stone
        wait 7 seconds
        set event-block to diamond ore
    if event-block is emerald ore:
        add 8 emerald ore to player
        cancel event
        set event-block to stone
        wait 8 seconds
        set event-block to emerald ore
    if event-block is quartz ore:
        add 9 quartz ore to player
        cancel event
        set event-block to stone
        wait 9 seconds
        set event-block to quartz ore
command /ores <player>:
    executable by: console or player
    trigger:
        clear {guiwarps::%uuid of player%::*}
        open chest with 2 rows named "&cBalance: %player's money%" to player
        format slot 0 of player with coal ore named "&8Coal Ore" with lore "&2$0.03" to run [player command "/coalsell"]
        format slot 1 of player with iron ore named "&7Iron Ore" with lore "&2$0.09" to run [player command ""]
        format slot 2 of player with lapis ore named "&9Lapis Ore" with lore "&2$0.27" to run [player command ""]
        format slot 3 of player with redstone ore named "&cRedstone Ore" with lore "&2$0.81" to run [player command ""]
        format slot 4 of player with gold ore named "&eGold Ore" with lore "&2$2.43" to run [player command ""]
        format slot 5 of player with diamond ore named "&bDiamond Ore" with lore "&2$7.29" to run [player command ""]
        format slot 6 of player with emerald ore named "&aEmerald Ore" with lore "&2$21.87" to run [player command ""]
        format slot 7 of player with quartz ore named "&7Quartz Ore" with lore "&2$65.61" to run [player command ""]   
command /xp:
    trigger:
        message "&8You have &a%{xp::%player%}% &8XP"
 
Your code works for me. Maybe you didn't relog after making the skript so it never set your xp since you set it when the player joins.
 
Will it sets it to 0 but when I mine a coal block I don't gain 1 xp
Hmmm i don't know what youre problem.
Maybe some plugins fucked up... For me works fine too. Look here.

upload_2017-5-13_3-53-43.png



Let us know your Skript version...
 
Hmmm i don't know what youre problem.
Maybe some plugins fucked up... For me works fine too. Look here.

View attachment 676


Let us know your Skript version...
ok tthanks

also it says I have the latest version
[doublepost=1494643497,1494640537][/doublepost]
Hmmm i don't know what youre problem.
Maybe some plugins fucked up... For me works fine too. Look here.

View attachment 676


Let us know your Skript version...
Got any ideas which plugins are doing this?
[doublepost=1494643691][/doublepost]
Hmmm i don't know what youre problem.
Maybe some plugins fucked up... For me works fine too. Look here.

View attachment 676


Let us know your Skript version...
ok nvm I removed some junk plugins and its fixed it could of been set hearts
 
Status
Not open for further replies.