Setting slots to item variables...?

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

Klyser8

Member
Mar 11, 2018
2
0
0
23
Skript Version: dev34
Skript Author: Klyser8
Minecraft Version: 1.12.2
---
Full Code:
code_language.skript:
on inventory click:
    if clicked type is right mouse button:
        if name of event-inventory contains "Booth":
            if event-slot is not air:
                if event-slot is not diamond hoe:85:
                    if event-slot is not diamond hoe:86:
                        if event-slot is not {@menu}:
                            if event-slot is not name tag:
                                if clicked item's name contains "lol":
                                    set {slot::%player's uuid%} to clicked slot
                                    set {boothitem::%player's uuid%} to event-slot
                                    set {boothitemname::%player's uuid%} to name of {boothitem::%player's uuid%}
                                    set {setprice::%player's uuid%} to true
                                    close player's inventory
                                    send "not name tag boi"
    else if clicked type is left mouse button:
        format gui slot {slot::%player's uuid%} of player with {boothitem::%player's uuid%}
        send "%{boothitem::%player's uuid%}%"

code_language.skript:
on chat:
    if {setprice::%player's uuid%} is true:
        cancel event
        set {setprice::%{slot:%player's uuid%}%} to message
        if (message parsed as integer) is set:
            send "&aYou succesfully set the price of the item to &e%{setprice::%{slot:%player's uuid%}%}%&a."
            set {setprice::%player's uuid%} to false
            open "CHEST" with 3 row named "&e%player%'s &8Private Booth" to player
            loop {shopmenu::%player's uuid%::*}:
                set slot loop-index parsed as number of player's current inventory to loop-value
                #create gui slot {slot::%player's uuid%} of player with "%{boothitem::%player's uuid%}%" named "%{boothitemname::%player's uuid%}%"
                create gui slot 1, 7, 9, 10, 16, 18, 19, 25 and 26 of player with {@menu} named "{@menuname}"
                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
                create gui slot 0 of player with {@exit} named "{@exitname}" to close
                create gui slot 17 of player with name tag named "&5Rename Shop" to close
                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%}%}%"
            broadcast "&a%{slot::%player's uuid%}%, &b%{boothitem::%player's uuid%}%, %{boothitemname::%player's uuid%}% &fCost: &6%{setprice::%{slot:%player's uuid%}%}%"

Errors on Reload:

code_language.skript:
'::%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.
 
Im going to take a shot at this, I apologize Im not 100% sure if this is the problem
but here
code_language.skript:
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
 
Im going to take a shot at this, I apologize Im not 100% sure if this is the problem
but here
code_language.skript:
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

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.
 
Status
Not open for further replies.