Jump to content

Is there a way to do something like this? (SKRIPT)


Darth1013

Recommended Posts

8 hours ago, _Mr_Puppy_ said:

let us see it so we know what we are dealing with

 

on first join:
 set {lvl} to 1

every 0 tick:
  if {lvl} is equal to 1:
    set {moneyrequired} to 100
  if {lvl} is equal to 2:
    set {moneyrequired} to 250
  if {lvl} is equal to 3:
    set {moneyrequired} to 500



on right click with wooden sword:
  open virtual chest inventory with size 3 named "&dUpgrade" to player
  format gui slot 0,1,2,3,4,5,6,7,8 of player with gray stained glass pane named "&5-"
  format gui slot 18,19,20,21,22,23,24,25,26 of player with gray stained glass pane named "&5-"
  format gui slot 13 of player with red stained glass pane named "&dUpgrade" with lore "&c$%{moneyrequired}%" to run:
    if balance of player > {moneyrequired}:
	#adds enchant to be +1
      enchant the tool with "sharpness %level of sharpness of the tool + 1%" parsed as enchantment type
	  #adds the lvl
      add 1 to {lvl}
	  #fixes price and lvl
      format gui slot 13 of player with barrier named "&cReseting"
      wait 3 ticks
      loop to line 18:

command /reset:
 trigger:
  send "Reset!"
  set {lvl} to 1
  clear inventory of player
  give player wooden sword

All but  "loop to line 18" work...

Link to comment
Share on other sites

on first join:
    set {lvl} to 1

every 0 tick:
    if {lvl} is equal to 1:
        set {moneyrequired} to 100
    if {lvl} is equal to 2:
        set {moneyrequired} to 250
    if {lvl} is equal to 3:
        set {moneyrequired} to 500



on right click with wooden sword:
    execute player command "upgradereset 521"

command /reset:
    trigger:
        send "Reset!"
        set {lvl} to 1
        clear inventory of player
        give player wooden sword

command /upgradereset <string>:
    trigger:
        if arg-1 is "521":
            open virtual chest inventory with size 3 named "&dUpgrade" to player
            format gui slot 0,1,2,3,4,5,6,7,8 of player with gray stained glass pane named "&5-"
            format gui slot 18,19,20,21,22,23,24,25,26 of player with gray stained glass pane named "&5-"
            format gui slot 13 of player with red stained glass pane named "&dUpgrade" with lore "&c$%{moneyrequired}%" to run:
                if balance of player > {moneyrequired}:
                    #adds enchant to be +1
                    enchant the tool with "sharpness %level of sharpness of the tool + 1%" parsed as enchantment type
                    #adds the lvl
                    add 1 to {lvl}
                    #fixes price and lvl
                    format gui slot 13 of player with barrier named "&cReseting"
                    wait 3 ticks
                    execute player command "upgradereset 521"

I made it into a command so it will execute it after they click the glass pane. Also, you need to learn how to use variables...

 

Owner of play.hiveminez.net

 

⊱------------------------------⊰

Joined Minehut on 1/28/2021 (Same day I got Minecraft)

[VIP] - 3/14/2021

[LEGEND] - 5/27/2021

⊱------------------------------⊰

Discord - NotKaizo#0001

In-game name - iKaizo_

If you need any help, feel free to contact me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...