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.

Want to make a levelup gang system

Discussion in 'Skript' started by Moonl1ght, Aug 4, 2019.

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

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    What I want to make is a skript that every 2k blocks you(and/or your gang) breaks it levels up and gets a +1% sellboost. The problem is I am new to skript and can't get further then counting the blocks broken


    My code:


    on break:
    if tool is a pickaxe:
    add 1 to {pickaxe.break.%player%}
    add 1 to {blocks.broken.%player%}
    else:
    add 1 to {blocks.broken.%player%}
    command /gang [<text>] [<text>]:
    aliases: /g
    trigger:
    if arg-1 is not set:
    make player execute command "/gang info"
    if arg 1 is "info":
    send "&e-----------"
    send "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
    send "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
    send "&e-----------"


    on join:
    if {pickaxe.break.%player%} is not set:
    set {pickaxe.break.%player%} to 0
     
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    313
    Likes Received:
    20
    Code (Text):
    1. on break:
    2.   if tool is a pickaxe:
    3.     add 1 to {pickaxe.break.%player%}
    4.   add 1 to {blocks.broken.%player%}
    5.  
    6. command /gang [<text>] [<text>]:
    7.   aliases: /g
    8.   trigger:
    9.     if arg-1 is not set:
    10.       make player execute command "/gang info" # another option would be to print the gang info shit here
    11.     else if arg-1 is "info":
    12.       send "&e-----------"
    13.       send "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
    14.       send "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
    15.       send "&e-----------"
    16.  
    17.  
    18. on join:
    19.   if {pickaxe.break.%player%} is not set:
    20.     set {pickaxe.break.%player%} to 0 # save this to a file
    Cleaned up your code, to do that you loop all players, then check if {pickaxe.break.%loop-player%} is greater than 2000, if the condition is true do whatever the hell you want to do
     
  3. Moonl1ght

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    Thank you so much I'll try it out right away
    --- Double Post Merged, Aug 6, 2019, Original Post Date: Aug 6, 2019 ---
    Any chance u could send me an example or help me out because I don't get it
     
  4. Mich7272

    Mich7272 Well-Known Member

    Joined:
    Apr 12, 2019
    Messages:
    49
    Likes Received:
    0
    Code (Text):
    1. on break:
    2.     if tool is a pickaxe:
    3.         set {pickaxe.break.%player%} to {pickaxe.break.%player%} + 1
    4.         set {blocks.broken.%player%} to {blocks.broken.%player%} + 1
    5.         set {blocks.levelup.%player%} to {blocks.levelup.%player%} + 1
    6.         if {blocks.levelup.%player%} is more than or equal to 2000:#checks if the player already mine 2k blocks
    7.             set {blocks.levelup.%player%} to 0#reset the level up variable
    8.             set {blocks.level.%player%} to {blocks.level.%player%} + 1#add 1 to the variable this is the faster way I reed this somewere in skunity
    9.             message "&cYou level up the gang from %(%{blocks.levelup.%player%}% - 1)% to %{blocks.levelup.%player%}%" #Not sure if this will works ask some one else about this message
    10. command /gang [<text>] [<text>]:
    11.   aliases: /g
    12.   trigger:
    13.     if arg-1 is "info":
    14.         message "&e-----------"
    15.         message "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
    16.         message "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
    17.         message "&cCurrent level: %{blocks.level.%player%}%"#display the player gang level
    18.         message "&cNext level: %{blocks.levelup.%player%}%/2000"#show the player the blocks he has mine and how much more he needs to mine
    19.         message "&e-----------"
    20.     else if arg-1 is "help":
    21.         message "&e------------------------------------------------------------------"
    22.         message "&cCommands."
    23.         message "&c/gang info. Display pickaxe blocks broken and total blocks broken."
    24.         message "&c/gang help. Display this message."
    25.         message "&e------------------------------------------------------------------"
    26.     else:
    27.         message "&e------------------------------------------------------------------"
    28.         message "&cUnknow command try /gang help to get help.
    29.         message "&e------------------------------------------------------------------"
    30.  
    31. on join:
    32.     if {pickaxe.break.%player%} is not set:
    33.         set {pickaxe.break.%player%} to 0 # save this to a file
    34.     if {blocks.levelup.%player%} is not set:
    35.         set {block.levelup.%player%} to 0
    36.     if {blocks.level.%player%} is not set:
    37.         set {blocks.level.%player%} to 0
    Something like this?
    I fix some code things to the way people tell me is better like adding to a variable
    like this: set {var} to {var} + 1
    and send replace with message because some people say send is bugged
    --- Double Post Merged, Aug 6, 2019, Original Post Date: Aug 6, 2019 ---
    Also I really recommend if you create a command to do like make player execute "the command" because you will have console espam use functions if you will repeat the same code a few times
     
  5. Moonl1ght

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    [/SPOILER]
    Something like this?
    I fix some code things to the way people tell me is better like adding to a variable
    like this: set {var} to {var} + 1
    and send replace with message because some people say send is bugged
    --- Double Post Merged, Aug 6, 2019, Original Post Date: Aug 6, 2019 ---

    Also I really recommend if you create a command to do like make player execute "the command" because you will have console espam use functions if you will repeat the same code a few times[/QUOTE]
    --- Double Post Merged, Aug 8, 2019 ---
    Encountered a bug with this. Everything I break a block it just adds +1 to the number not in total
    Image:
    https://gyazo.com/ccec922a77354439a05a3bea276bcfdb
    Everytime I reload the skript it fixes it selfs. But If I mine again It starts bugging again
     
    #5 Moonl1ght, Aug 8, 2019
    Last edited: Aug 8, 2019
  6. Mich7272

    Mich7272 Well-Known Member

    Joined:
    Apr 12, 2019
    Messages:
    49
    Likes Received:
    0
    --- Double Post Merged, Aug 8, 2019 ---


    Encountered a bug with this. Everything I break a block it just adds +1 to the number not in total
    Image:
    https://gyazo.com/ccec922a77354439a05a3bea276bcfdb
    Everytime I reload the skript it fixes it selfs. But If I mine again It starts bugging again[/QUOTE]
    OK I will help you later with this
     
  7. Moonl1ght

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    OK I will help you later with this[/QUOTE]

    Thank you
    --- Double Post Merged, Aug 8, 2019, Original Post Date: Aug 8, 2019 ---
    Thank you[/QUOTE]
    {edit} Found the problem, just needed to update skript lol
     
  8. Mich7272

    Mich7272 Well-Known Member

    Joined:
    Apr 12, 2019
    Messages:
    49
    Likes Received:
    0
    Thank you
    --- Double Post Merged, Aug 8, 2019, Original Post Date: Aug 8, 2019 ---


    Thank you[/QUOTE]
    {edit} Found the problem, just needed to update skript lol[/QUOTE]
    hahaha ok glad it work have fun
     
Thread Status:
Not open for further replies.
Loading...