Jump to content

Leveling System Help


Up1x

Recommended Posts

Ok so I was working on this leveling system where players recieve xp for mining blocks and this is what I got so far: 

 

variables:
   {playerlevel} = 1
   {playerexperience} = 0


On mine:
   add 0.1 to {playerexperience}

if {playerexperience} is equal to 1:
   set {playerlevel} to 2

Whenever I run the skript It comes back with an error saying that it can not understand the event: 'if {playerexperience} is equal to 1:'

Anyone know whats wrong here?

thanks

 

(Kinda new to skript so sorry if it is a dumb mistake I made)

Edited by Up1x
Link to comment
Share on other sites

You can't have an if statement on it's own, it has to be in an event or after a trigger.
Also, I would suggest changing your variables, because right now experience is just being added to a variable, it's not being added to the player's own experience. Here's a small fix

variables:
   {playerlevel::%player's uuid%} = 1
   {playerexperience::%player's uuid%} = 0


on mine:
    if {playerexperience::%player's uuid%} = 1:
        add 1 to {playerlevel::%player's uuid%}
        set {playerexperience::%player's uuid%} to 0
    else:
        add 0.1 to {playerexperience::%player's uuid%}

# Fixed the variables so that it's not just adding it to a variable, it adds to the player's variable
#
# Also fixed up the mine event
   

If you have any further issues, don't hesitate to reply to this thread and I or someone else will try and help you.

Junior Mod (01/04/2020) - Resigned 

 Discord » Koronotchi#0001 
Minecraft Username » Koronotchi 

image.png.17a385f298c8969f6b1cf03e27ee50d3.png

 

Link to comment
Share on other sites

Awesome! just one thing, when I put it into my server it came back with errors:

can't understand the type 'players's uuid' in {playerlevel::%player's uuid%} = 1

can't understand the type 'player's uuid' in {playerexperience::%player's uuid%} = 0

I tried looking into this issue but could not find anything

Link to comment
Share on other sites

6 hours ago, Up1x said:

Awesome! just one thing, when I put it into my server it came back with errors:

can't understand the type 'players's uuid' in {playerlevel::%player's uuid%} = 1

can't understand the type 'player's uuid' in {playerexperience::%player's uuid%} = 0

I tried looking into this issue but could not find anything

I suppose you could replace it with:

on first join:
    set {var} to 0
    set {var2} to 1

 

Junior Mod (01/04/2020) - Resigned 

 Discord » Koronotchi#0001 
Minecraft Username » Koronotchi 

image.png.17a385f298c8969f6b1cf03e27ee50d3.png

 

Link to comment
Share on other sites

  • 10 months later...

Topic Locked. 

Please do not reply on month-old threads that have been inactive! (necroposting).

 

𝚄𝚗𝚝𝚛𝚎𝚊𝚝𝚎𝚍

𝔻𝕚𝕤𝕔𝕠𝕣𝕕: @𝕌𝕟𝕥𝕣𝕖𝕒𝕥𝕖𝕕#𝟘𝟘𝟘𝟙

News & Updates  Rules • Helper Application

Reports • Appeals

𝚂𝚝𝚊𝚏𝚏 𝚘𝚗 𝙼𝚒𝚗𝚎𝚑𝚞𝚝 𝚜𝚒𝚗𝚌𝚎 𝙹𝚞𝚗𝚎 𝟹𝟶𝚝𝚑, 𝟸𝟶𝟸𝟶

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...