Want to make a levelup gang 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!

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

tumm

Supporter
Aug 4, 2019
6
0
1
22
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
 
Code:
on break:
  if tool is a pickaxe:
    add 1 to {pickaxe.break.%player%}
  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" # another option would be to print the gang info shit here
    else 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 # 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

Thank you so much I'll try it out right away
[doublepost=1565100737,1565084696][/doublepost]
Code:
on break:
  if tool is a pickaxe:
    add 1 to {pickaxe.break.%player%}
  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" # another option would be to print the gang info shit here
    else 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 # 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
Any chance u could send me an example or help me out because I don't get it
 
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
Code:
on break:
    if tool is a pickaxe:
        set {pickaxe.break.%player%} to {pickaxe.break.%player%} + 1
        set {blocks.broken.%player%} to {blocks.broken.%player%} + 1
        set {blocks.levelup.%player%} to {blocks.levelup.%player%} + 1
        if {blocks.levelup.%player%} is more than or equal to 2000:#checks if the player already mine 2k blocks
            set {blocks.levelup.%player%} to 0#reset the level up variable
            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
            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
command /gang [<text>] [<text>]:
  aliases: /g
  trigger:
    if arg-1 is "info":
        message "&e-----------"
        message "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
        message "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
        message "&cCurrent level: %{blocks.level.%player%}%"#display the player gang level
        message "&cNext level: %{blocks.levelup.%player%}%/2000"#show the player the blocks he has mine and how much more he needs to mine
        message "&e-----------"
    else if arg-1 is "help":
        message "&e------------------------------------------------------------------"
        message "&cCommands."
        message "&c/gang info. Display pickaxe blocks broken and total blocks broken."
        message "&c/gang help. Display this message."
        message "&e------------------------------------------------------------------"
    else:
        message "&e------------------------------------------------------------------"
        message "&cUnknow command try /gang help to get help.
        message "&e------------------------------------------------------------------"
 
on join:
    if {pickaxe.break.%player%} is not set:
        set {pickaxe.break.%player%} to 0 # save this to a file
    if {blocks.levelup.%player%} is not set:
        set {block.levelup.%player%} to 0
    if {blocks.level.%player%} is not set:
        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
[doublepost=1565105240,1565104724][/doublepost]
Code:
on break:
    if tool is a pickaxe:
        set {pickaxe.break.%player%} to {pickaxe.break.%player%} + 1
        set {blocks.broken.%player%} to {blocks.broken.%player%} + 1
        set {blocks.levelup.%player%} to {blocks.levelup.%player%} + 1
        if {blocks.levelup.%player%} is more than or equal to 2000:#checks if the player already mine 2k blocks
            set {blocks.levelup.%player%} to 0#reset the level up variable
            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
            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
command /gang [<text>] [<text>]:
  aliases: /g
  trigger:
    if arg-1 is "info":
        message "&e-----------"
        message "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
        message "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
        message "&cCurrent level: %{blocks.level.%player%}%"#display the player gang level
        message "&cNext level: %{blocks.levelup.%player%}%/2000"#show the player the blocks he has mine and how much more he needs to mine
        message "&e-----------"
    else if arg-1 is "help":
        message "&e------------------------------------------------------------------"
        message "&cCommands."
        message "&c/gang info. Display pickaxe blocks broken and total blocks broken."
        message "&c/gang help. Display this message."
        message "&e------------------------------------------------------------------"
    else:
        message "&e------------------------------------------------------------------"
        message "&cUnknow command try /gang help to get help.
        message "&e------------------------------------------------------------------"
 
on join:
    if {pickaxe.break.%player%} is not set:
        set {pickaxe.break.%player%} to 0 # save this to a file
    if {blocks.levelup.%player%} is not set:
        set {block.levelup.%player%} to 0
    if {blocks.level.%player%} is not set:
        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
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
 
[/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
[doublepost=1565105240,1565104724][/doublepost]
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]
[doublepost=1565259372][/doublepost]
Code:
on break:
    if tool is a pickaxe:
        set {pickaxe.break.%player%} to {pickaxe.break.%player%} + 1
        set {blocks.broken.%player%} to {blocks.broken.%player%} + 1
        set {blocks.levelup.%player%} to {blocks.levelup.%player%} + 1
        if {blocks.levelup.%player%} is more than or equal to 2000:#checks if the player already mine 2k blocks
            set {blocks.levelup.%player%} to 0#reset the level up variable
            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
            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
command /gang [<text>] [<text>]:
  aliases: /g
  trigger:
    if arg-1 is "info":
        message "&e-----------"
        message "&cPickaxe blocks broken: &4%{pickaxe.break.%player%}%"
        message "&cTotal blocks broken: &4%{blocks.broken.%player%}%"
        message "&cCurrent level: %{blocks.level.%player%}%"#display the player gang level
        message "&cNext level: %{blocks.levelup.%player%}%/2000"#show the player the blocks he has mine and how much more he needs to mine
        message "&e-----------"
    else if arg-1 is "help":
        message "&e------------------------------------------------------------------"
        message "&cCommands."
        message "&c/gang info. Display pickaxe blocks broken and total blocks broken."
        message "&c/gang help. Display this message."
        message "&e------------------------------------------------------------------"
    else:
        message "&e------------------------------------------------------------------"
        message "&cUnknow command try /gang help to get help.
        message "&e------------------------------------------------------------------"
 
on join:
    if {pickaxe.break.%player%} is not set:
        set {pickaxe.break.%player%} to 0 # save this to a file
    if {blocks.levelup.%player%} is not set:
        set {block.levelup.%player%} to 0
    if {blocks.level.%player%} is not set:
        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
[doublepost=1565105240,1565104724][/doublepost]
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

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
 
Last edited:
[/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
[doublepost=1565105240,1565104724][/doublepost]
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
[doublepost=1565259372][/doublepost]

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
 
[doublepost=1565259372][/doublepost]

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
OK I will help you later with this[/QUOTE]

Thank you
[doublepost=1565296378,1565294280][/doublepost]
OK I will help you later with this

Thank you[/QUOTE]
{edit} Found the problem, just needed to update skript lol
 
Status
Not open for further replies.