Leveling system

  • 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.
Jul 16, 2020
30
2
8
18
I have a level system, and it wont work. It wont level up but the chat format works.
 

Attachments

  • level.sk
    587 bytes · Views: 569
When asking for help, you really should provide adequate information regarding the problem.
Saying "it wont work" simply isn't enough.
 
Ok, when I like break coal ore and kill, it wont let me level up. Like I cant make it to work. It should be like that but it doesnt add 1 to {level::%player%}
 
You should learn how to read error codes.
When using the "every x" event, and you are doing something player related, you need to loop all players first.
so this should be working, but haven't tested it though.
Code:
variables:
    {level::%player%} = 1
    {max::%player%} = 10
    {xp::%player%} = 0

on chat:
    set message format to "&7[&a%{level::%player%}%&7] %player's displayname%&7: %message%"

on death:
    if attacker is a player:
        add 2 to {xp::%attacker%}

every 0.2 seconds:
    loop all players:
        if {xp::%loop-player%} is higher or equal to {max::%loop-player%}:
            message "&aYou've leveled up to %{level::%loop-player%}%" to player
            add 40 to {max::%loop-player%}
            set {xp::%loop-player%} to 0
            add 1 to {level::%loop-player%}

on break of coal ore:
    add 0.5 to {xp::%player%}
 
Status
Not open for further replies.