Discord Thread Level 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!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
code_language.skript:
on first join:
    set {level::%player's uuid%} to 0

on break of wheat[age=7]:
    add 1 to {xp::%player's uuid%}
    send action bar "&a+1 &6exp" to player
    if {lvreq::%player's uuid%} is not set:
        if {xp::%player's uuid%} > 100:
            set {lvreq1::%player's uuid%} to 1
            add 1 to {level::%player's uuid%}
            send title "&6You have leveled up to level &c%{level::%player's uuid%}%"
            set {xp::%player's uuid%} to 0
    if {lvreq1::%player's uuid%} = 1:
        if {xp::%player's uuid%} > 200:
            add 1 to {lvreq1::%player's uuid%}
            add 1 to {level::%player's uuid%}
            send title "&6You have leveled up to level &c%{level::%player's uuid%}%"
            set {xp::%player's uuid%} to 0
    if {lvreq::%player's uuid%} = 2:
        if {xp::%player's uuid%} > 300:
            add 1 to {lvreq1::%player's uuid%}
            add 1 to {level::%player's uuid%}
            send title "&6You have leveled up to level &c%{level::%player's uuid%}%"
            set {xp::%player's uuid%} to 0
    if {lvreq::%player's uuid%} = 3:
        if {xp::%player's uuid%} > 400:
            add 1 to {lvreq1::%player's uuid%}
            add 1 to {level::%player's uuid%}
            send title "&6You have leveled up to level &c%{level::%player's uuid%}%"
            set {xp::%player's uuid%} to 0
    if {lvreq::%player's uuid%} = 4:
        if {xp::%player's uuid%} > 500:
            add 1 to {lvreq::%player's uuid%}
            add 1 to {level::%player's uuid%}
            send title "&6You have leveled up to level &c%{level::%player's uuid%}%"
            set {xp::%player's uuid%} to 0
how to i make this actually work

Posted by: robstark1 from the skUnity Discord. View the thread on skUnity Discord here
 
also he is setting it to 0 which is bad he should just remove the xp requirement because lets say he gets 100 xp and he goes from 487 to 587 now he just lost 87 xp

Posted by: .samgomez from the skUnity Discord.
 
I actually did it in 6 lines
lmao
you were right
code_language.skript:
vb
function levelup(p: player):
  set {_uuid} to {_p}'s uuid
  if {xp::%{_uuid}%} >= {xpmax::%{_uuid}%}:
    remove {xpmax::%{_uuid}%} from {xp::%{_uuid}%}
    add 1 to {Level::%{_uuid}%}
    add 100 to {xpmax::%{_uuid}%}
6 lines

Posted by: .samgomez from the skUnity Discord.
 
i counted the line send "you leveled up" to player
i just used {_p}'s uuid and didnt waste a line setting {_uuid}
^
{xp::%player's uuid%} >= 100 * {level::%player's uuid%}
code_language.skript:
on break of wheat[age=7]:
  add 1 to {xp::%player's uuid%}
  {xp::%player's uuid%} >= 100 * {level::%player's uuid%}
  add 1 to {level::%player's uuid%}
  # send "&6You have leveled up to level &c%{level::%player's uuid%}%" to player
  remove 100 * {level::%player's uuid%} from {xp::%player's uuid%}

Posted by: x8ight from the skUnity Discord.
 
Status
Not open for further replies.