Jump to content

RPG Xp System Skript


Elixzer

Recommended Posts

Variables:
    {xp.%player%}
    {xpmax.%player%}
    {level.%player%}

on mine of any ore:
  add 1 to {xp.%player%}
  send action bar "&r+1 XP &8| &r+1 BALANCE" to player
  add 1 to player's balance

on death:
  attacker is a player:
    victim is an entity:
      add 1 to {xp.%attacker%}
      send action bar "&r+1 XP &8| &r+1 BALANCE" to attacker
      add 1 to attacker's balance

every 0.1 tick:
  loop all players:
    if {xp.%loop-player%} = {xpmax.%loop-player%}:
      add 1 to {level.%loop-player%}
      clear {xp.%loop-player%}

command /stats:
  trigger:
    send "&8============================================" to player
    send "&7Xp: &r%{xp.%player%}% &7/ &r%{xpmax.%player%}%" to player
    send "&7Current Level: &r%{level.%player%}%" to player
    send "&8============================================" to player
    

Didn't test this yet. But I'm kind of sure that no errors will occur.

Requirements:

- Skript

- SkQuery (Optional)

- Skellet (Optional)

 

2034353234_YoutubeBannerComplete(8).png.1cc6aa3ba93fea6600b8eb268b591100.png

 

Link to comment
Share on other sites

All in all looks like a pretty simple skript but

every 0.1 tick:

is not a good idea, especially with multiple players being on the server. Maybe add it as a function instead or just let it loop around every few seconds and not every tick.

It would be 256952237757169664.png.d18a09670746c6c6079d9c16a0ee3647.png if you could upvote my post if you found it helpful.

image.png.beca96975a3b4f2ba756ddf6d7eebbb2.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...