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

Setting slots to item variables...?

Discussion in 'Skript' started by Klyser8, Apr 4, 2018.

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

    Klyser8 Member

    Joined:
    Mar 11, 2018
    Messages:
    2
    Likes Received:
    0
    Skript Version: dev34
    Skript Author: Klyser8
    Minecraft Version: 1.12.2
    ---
    Full Code:
    Code (Skript):
    1.  
    2. on inventory click:
    3.     if clicked type is right mouse button:
    4.         if name of event-inventory contains "Booth":
    5.             if event-slot is not air:
    6.                 if event-slot is not diamond hoe:85:
    7.                     if event-slot is not diamond hoe:86:
    8.                         if event-slot is not {@menu}:
    9.                             if event-slot is not name tag:
    10.                                 if clicked item's name contains "lol":
    11.                                     set {slot::%player's uuid%} to clicked slot
    12.                                     set {boothitem::%player's uuid%} to event-slot
    13.                                     set {boothitemname::%player's uuid%} to name of {boothitem::%player's uuid%}
    14.                                     set {setprice::%player's uuid%} to true
    15.                                     close player's inventory
    16.                                     send "not name tag boi"
    17.     else if clicked type is left mouse button:
    18.         format gui slot {slot::%player's uuid%} of player with {boothitem::%player's uuid%}
    19.         send "%{boothitem::%player's uuid%}%"
    Code (Skript):
    1.  
    2. on chat:
    3.     if {setprice::%player's uuid%} is true:
    4.         cancel event
    5.         set {setprice::%{slot:%player's uuid%}%} to message
    6.         if (message parsed as integer) is set:
    7.             send "&aYou succesfully set the price of the item to &e%{setprice::%{slot:%player's uuid%}%}%&a."
    8.             set {setprice::%player's uuid%} to false
    9.             open "CHEST" with 3 row named "&e%player%'s &8Private Booth" to player
    10.             loop {shopmenu::%player's uuid%::*}:
    11.                 set slot loop-index parsed as number of player's current inventory to loop-value
    12.                 #create gui slot {slot::%player's uuid%} of player with "%{boothitem::%player's uuid%}%" named "%{boothitemname::%player's uuid%}%"
    13.                 create gui slot 1, 7, 9, 10, 16, 18, 19, 25 and 26 of player with {@menu} named "{@menuname}"
    14.                 create gui slot 8 of player with {@check} named "&aClose shop" with lore "&8&lWarning! &r&8You won't be able to edit||&8the items on sale and their price!" to close
    15.                 create gui slot 0 of player with {@exit} named "{@exitname}" to close
    16.                 create gui slot 17 of player with name tag named "&5Rename Shop" to close
    17.                 set slot {slot::%player's uuid%} of player's current inventory to 1 {boothitem::%player's uuid%} named "%{boothitemname::%player's uuid%}% &fCost: &6%{setprice::%{slot:%player's uuid%}%}%"
    18.             broadcast "&a%{slot::%player's uuid%}%, &b%{boothitem::%player's uuid%}%, %{boothitemname::%player's uuid%}% &fCost: &6%{setprice::%{slot:%player's uuid%}%}%"
    19.  
    Errors on Reload:

    Code (Skript):
    1. '::%player's uuid%} named "%{boothitemname::%player's uuid%}% &fCost: &6%{setprice::%{slot%player's uuid%}%}%"' is not a valid item data (line 131).
    Console Errors:

    none

    Addons using (including versions):
    skUtilities 0.9.0
    Skellett 1.9.6
    skript-mirror-0.9.0
    skRPG-Lime (idk what version)
    skRayFall 1.9.12
    skQuery-Lime (idk version)
    Skellett (again...?)
    Tuske
    Troubleshooting:

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
    What other methods have you tried to fix it?
    After a lot of testing I kinda figured that the skript has issues setting items which are stored in variables in slots, since trying to set the item to stone (changing only that) seemed to fix everything. The issue is not with setting the variable but I guess retrieving it.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Im going to take a shot at this, I apologize Im not 100% sure if this is the problem
    but here
    Code (Skript):
    1. set {boothitem::%player's uuid%} to event-slot
    You're setting the variable to the slot... So I don't think its setting it to the "ITEM" in the slot, but to the actual SLOT, i.e. the number of the slot
     
  3. Klyser8

    Klyser8 Member

    Joined:
    Mar 11, 2018
    Messages:
    2
    Likes Received:
    0
    I stated in the support request that it has nothing to do with setting the variables but retrieving them in line 17 of the second code, second variable from the left (...current inventory to 1 {boothitem::%player's uuid%}) I tried asking for help everywhere but I did not find a solution, and neither did the people I asked help to.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Probably because that variable is set wrong in the first place you’re not getting the right thing back from it.
     
Thread Status:
Not open for further replies.
Loading...