Documentation for Skript no longer working

Discussion in 'Skript' started by CraftrDoinBetter, Jan 18, 2020.

  1. I am making a shop gui for my server and this is the skript I am making for it:

    command /sellshop:
    trigger:
    open chest with 4 rows named "Sell Shop" to player
    format slot 1 of player with gunpowder named "Gunpowder, Sell For 10 Dollars" to close then run [make player execute command "/ssell gunpowder"]
    format slot 3 of player with bones named "Bones, Sell For 1 Dollar" to close then run [make player execute command "/ssell bones"]

    command /buyshop:
    trigger:
    open chest with 4 rows named "&9BuyShop" to player
    format slot 1 of player with bone named "&2Bone, Buy for 1 dollar" to close then run [make player execute command "/sbuy bone"]
    format slot 3 of player with gunpowder named "&9Gunpowder, Buy for 10 dollars" to close then run [make player execute command "/sbuy gunpowder"]

    command /ssell <item>:
    trigger:
    if %arg-1% is "gunpowder":
    if the player has gunpowder:
    remove 1 gunpowder from player
    add 10 to {currency.%player%}
    else if %arg-1% is "bones":
    if the player has bone:
    remove 1 bone from player
    add 1 to {currency.%player%}

    command /sbuy <item>:
    trigger:
    if %arg-1% is "gunpowder":
    if {currency.%player%} is greater than 9:
    give 1 gunpowder to the player
    remove 10 from {currency.%player%}
    else if %arg-1% is "bone":
    if {currency.%player%} is greater than 0:
    give 1 bone to the player
    remove 1 from {currency.%player%}

    command /sbalance:
    trigger:
    send "Your Current Balance" to player
    send {currency.%player%} to player

    command /sbal:
    trigger:
    send "Your Current Balance" to player
    send {currency.%player%} to player

    The only thing that works is the "/ssell" command I made.
    Did the Skript plugin update or something? I'm really confused.
    The GUI works but the it won't make the player execute the commands, even the sell command that works if executed manually.
    Edit: Only the bone part of the sell command works in the GUI and manually. The gunpowder part doesn't work. The /sbal and /sbalance and /sbuy doesn't work either. The sellshop is formatting when it opens, but when I open the buyshop no items show up.
     
    #1 CraftrDoinBetter, Jan 18, 2020
    Last edited: Jan 18, 2020
    • Like Like x 1
  2. don't use "format slot", it is buggy and should never be used. use set slot and on inventory click combo instead.


    also it is much better to use list variables, such as {variable::%uuid of player%} than {variable.%player%}, because they are much easier to manage, you can do various useful actions with them, like:
    Code (Text):

      set {variable::italy} to "&9Dream of Italy"
      set {variable::egypt} to "&ePyramid of Egypt"

      send "List of maps:"
      loop {variable::*}:
        send "%loop-value%"
      send "There are %amount of {variable::*}% maps in this game."

      set {variable::*} to all players in radius 10 of player
      teleport {variable::*} to location of player
      give a diamond to {variable::*}

      loop {variable::*}:
        if loop-value is offline:
          delete {variable::%loop-index%}

      teleport {variable::*} to spawn point of world ("world" parsed as a world)
      send "Game has started!" to {variable::*}

      kill {variable::*}
      delete {variable::*}
     
    even if you do not need that kind of functionality, there is no point in not using list variables, just in case if you will ever need it. List variables are absolutely superior to dot variables.