Spam message

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

SpeedBlock

Member
Jan 26, 2017
22
1
0
22
Hi. I need help with this code. What happens is that it sends me many messages when I continue to bite

code_language.skript:
on mine:
    if {xp.minero.%player%} is more than 50:
        add 1 to {level.minero.%player%}
        broadcast "&a%player% &7ha subido al nivel 1 en mineria &f!"
        if player's tool is a pickaxe:
            evaluate "enchant player's tool with efficiency %level of efficiency of player's tool + 1%"
            send "&2&lRecompensa &f+&e1 &fEficiencia"
 
First of all, you should be using list variables for that kind of stuff, you'll thank me later. Now, the issue is that you're not resetting the xp when they level up, you should delete that variable when it's more than 50.
 
code_language.skript:
on mine:
    if {xp.minero.%player%} is more than 50:
        delete {xp.minero.%player%}
        add 1 to {level.minero.%player%}
        broadcast "&a%player% &7ha subido al nivel 1 en mineria &f!"
        if player's tool is a pickaxe:
            evaluate "enchant player's tool with efficiency %level of efficiency of player's tool + 1%"
            send "&2&lRecompensa &f+&e1 &fEficiencia"
 
Status
Not open for further replies.