If {} reach ...

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

iGniSs

Member
May 3, 2017
18
0
0
24
Skript Version: Skript 2.2 (dev26f)
Skript Author: Bensku
Minecraft Version: 1.11.2

Problem:
Im creating custom levels/jobs system.
F.e.:
code_language.skript:
on break of stone:
    add 1 to {xp.%player%}
on break of diamond ore:
    add 10 to {xp.%player%}

How can i create something like this:
code_language.skript:
if {xp.%player%} reach 10:
    send message "blabla"
    set {lvl.%player%} to 1
 
Skript Version: Skript 2.2 (dev26f)
Skript Author: Bensku
Minecraft Version: 1.11.2

Problem:
Im creating custom levels/jobs system.
F.e.:
code_language.skript:
on break of stone:
    add 1 to {xp.%player%}
on break of diamond ore:
    add 10 to {xp.%player%}

How can i create something like this:
code_language.skript:
if {xp.%player%} reach 10:
    send message "blabla"
    set {lvl.%player%} to 1
Done
code_language.skript:
on break of any stone:
    add 1 to {xp.%player%}
    if {xd.%player%} is more than or equal to 10:
    send "bla"
on break of diamond ore:
    add 10 to {xp.%player%}
    if {xd.%player%} is more than or equal to 10:
        send "bla"
Also you can do this

code_language.skript:
on break of any stone:
    add 1 to {xp.%player%}
    if {xd.%player%} is more than or equal to 10:
    send "bla"
on break of diamond ore:
    add 10 to {xp.%player%}
    if {xd.%player%} is more than or equal to 10:
        send "bla"
        subtract 10 from {xd.%player%}
 
  • Like
Reactions: iGniSs
But i want this:
If player reached 10xp it gives player {lvl.%player%} to 1 and now player must reach 20xp for level up to 2.
 
Easy way:

code_language.skript:
on break of any stone:
    add 1 to {xp.%player%}
    if {LvL.%player%} * 10 is more than or equal {xp.%player%}:#it will evertime *10 (Level 3 * 10 = 30 xp need)
        send "level up!"
        add 1 to {LvL.%player%}
        set {xp.%player%} to 0
 
code_language.skript:
on break of any stone:
  add 1 to {xp.%player%}
  if {xd.%player%} is more than or equal to 10:
    send "bla"
    subtract 10 from {xd.%player%}
    add 1 to player's level
  on break of diamond ore:
    add 10 to {xp.%player%}
    if {xd.%player%} is more than or equal to 10:
      send "bla"
      subtract 10 from {xd.%player%}
      add 1 to player's level
 
Status
Not open for further replies.