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.

Item with Variable

Discussion in 'Skript' started by FusionCore, Apr 25, 2020.

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

    Supporter

    Joined:
    Apr 19, 2020
    Messages:
    44
    Likes Received:
    1
    Is there any way that you can replace an item with a variable like so:

    Code (Text):
    1. command /@buycmd:
    2.   trigger:
    3.     remove all gui slots of player
    4.     open virtual chest inventory with size 3 named "&7Trees101 @aShop&7: %{shopselected2.%player%}%" to player
    5.     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"
    6.     format gui slot 9 of player with lime stained glass pane named "&a+1" to run:
    7.       add 1 to {selectedbuyammount.%player%}
    8.       if {selectedbuyammount.%player%} is greater than 64:
    9.         set {selectedbuyammount.%player%} to 64
    10.     format gui slot 10 of player with lime stained glass pane named "&a+5" to run:
    11.       add 5 to {selectedbuyammount.%player%}
    12.       if {selectedbuyammount.%player%} is greater than 64:
    13.         set {selectedbuyammount.%player%} to 64
    14.     format gui slot 11 of player with lime stained glass pane named "&a+10" to run:
    15.       add 10 to {selectedbuyammount.%player%}
    16.       if {selectedbuyammount.%player%} is greater than 64:
    17.         set {selectedbuyammount.%player%} to 64
    18.     format gui slot 12 of player with lime stained glass pane named "&a+32" to run:
    19.       add 32 to {selectedbuyammount.%player%}
    20.       if {selectedbuyammount.%player%} is greater than 64:
    21.         set {selectedbuyammount.%player%} to 64
    22.     format gui slot 13 of player with {shopselected.%player%} named "&7%{shopselected.%player%}%" with lore "&eAmmount&7: &7%{selectedbuyammount.%player%}%"
    23.     format gui slot 14 of player with red stained glass pane named "&c-1" to run:
    24.       remove 1 from {selectedbuyammount.%player%}
    25.       if {selectedbuyammount.%player%} is less than 0:
    26.         set {selectedbuyammount.%player%} to 0
    27.     format gui slot 15 of player with red stained glass pane named "&c-5" to run:
    28.       remove 5 from {selectedbuyammount.%player%}
    29.       if {selectedbuyammount.%player%} is less than 0:
    30.         set {selectedbuyammount.%player%} to 0
    31.     format gui slot 16 of player with red stained glass pane named "&c-10" to run:
    32.       remove 10 from {selectedbuyammount.%player%}
    33.       if {selectedbuyammount.%player%} is less than 0:
    34.         set {selectedbuyammount.%player%} to 0
    35.     format gui slot 17 of player with red stained glass pane named "&c-32" to run:
    36.       remove 32 from {selectedbuyammount.%player%}
    37.       if {selectedbuyammount.%player%} is less than 0:
    38.         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!
     
    #1 FusionCore, Apr 25, 2020
    Last edited: Apr 25, 2020
Thread Status:
Not open for further replies.

Share This Page

Loading...