1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mining Progress Bar

Discussion in 'Skript' started by Mattllama987, May 14, 2021.

Thread Status:
Not open for further replies.
  1. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Hello everyone! I have a question. How can i get this to level up my pick after i mined 100 blocks? But each time it levels up the pick, the amount of blocks to mine would go up by x5 or something. Im a little confused on how i can do this. If anyone know how to do this, please let me know asap!

    Thanks!
    ~Matt

    Code:

    Code (Text):
    1. on break:
    2.     set {_bar} to progressBar(10, 50, "|", 50)
    3.     set line 8 of lore of player's held item to "&c%{_bar}%"
    4. function progressBar(currentValue: number, total: number, barChar: string = "|", barLength: integer = 20) :: string:
    5.     loop {_barLength} times:
    6.         set {_r} to "%{_r} ? """"%%{_barChar}%"
    7.     return ("&a%subtext of {_r} from indices 1 to (({_currentValue} / {_total}) * {_barLength} * (length of {_barChar}))%&c%(subtext of {_r} from indices (({_currentValue} / {_total}) * {_barLength} * (length of {_barChar}))+1 to (length of {_r})) ? """"%")
     
  2. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    This method you need to update, i'd suggest storing a variable to go into currentValue and increase that
     
  3. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Yeah, i could do that. But im having a level system for every pick. Each pick would have their own level ups. I would have to use local variables. Im just a little confused on how i could get this to work
     
Thread Status:
Not open for further replies.

Share This Page

Loading...