Item with Variable

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

FusionCore

Supporter
Apr 19, 2020
44
1
8
18
Is there any way that you can replace an item with a variable like so:

Code:
command /@buycmd:
  trigger:
    remove all gui slots of player
    open virtual chest inventory with size 3 named "&7Trees101 @aShop&7: %{shopselected2.%player%}%" to player
    format gui slot 0,1,2,3,5,6,7,8,18,19,20,21,22,23,24,25,26 of player with gray stained glass pane named "&7"
    format gui slot 9 of player with lime stained glass pane named "&a+1" to run:
      add 1 to {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is greater than 64:
        set {selectedbuyammount.%player%} to 64
    format gui slot 10 of player with lime stained glass pane named "&a+5" to run:
      add 5 to {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is greater than 64:
        set {selectedbuyammount.%player%} to 64
    format gui slot 11 of player with lime stained glass pane named "&a+10" to run:
      add 10 to {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is greater than 64:
        set {selectedbuyammount.%player%} to 64
    format gui slot 12 of player with lime stained glass pane named "&a+32" to run:
      add 32 to {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is greater than 64:
        set {selectedbuyammount.%player%} to 64
    format gui slot 13 of player with {shopselected.%player%} named "&7%{shopselected.%player%}%" with lore "&eAmmount&7: &7%{selectedbuyammount.%player%}%"
    format gui slot 14 of player with red stained glass pane named "&c-1" to run:
      remove 1 from {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is less than 0:
        set {selectedbuyammount.%player%} to 0
    format gui slot 15 of player with red stained glass pane named "&c-5" to run:
      remove 5 from {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is less than 0:
        set {selectedbuyammount.%player%} to 0
    format gui slot 16 of player with red stained glass pane named "&c-10" to run:
      remove 10 from {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is less than 0:
        set {selectedbuyammount.%player%} to 0
    format gui slot 17 of player with red stained glass pane named "&c-32" to run:
      remove 32 from {selectedbuyammount.%player%}
      if {selectedbuyammount.%player%} is less than 0:
        set {selectedbuyammount.%player%} to 0

The format gui slot 13 of player with {shopselected.%player%} named "&7%{shopselected.%player%}%"

is the one I need help with.

Please help! It could save me a lot of time.

Skript Version: This is the latest version!
 
Last edited:
Status
Not open for further replies.