#How to see if a slot have a specific name?
1 messages · Page 1 of 1 (latest)
on inventory click: if event-inventory = (metadata tag "tools" of player): cancel event if index of event-slot is 13: if event-slot 13 has the name "&6&lSTICK":
!format
:technologist: Code Blocks
To make it easier for others to read your code, it is asked that you send it in a code block. On Discord, you can simply send this:
```
Code here
```
full code?
what are you exactly trying to do
It doesnt work
...
I am trying to make like a shop with guis
????
Bro what
read the thing
How do i use the !format
....
BRO IDK
on inventory click:
if event-inventory = (metadata tag "tools" of player):
cancel event
if index of event-slot is 13:
if event-slot 13 has the name "&6&lSTICK":
finally
not so hard
uh
so what are you exactly trying to do
if you know that it's the right slot
if event-slot 13 has the name "&6&lSTICK": this part
then why would you check its name
Cus i am adding a shop kind of thing
yes
So like "When this variable is one show stick" "when it is 2 show a wooden shovel"
and it costs things too
what
?
I can see
idk what ur trying to do tho
so you checked if the event-slot is 13
so yk they clicked the right slot
why do u need to check the "name"
Ok so what i am trying to make is like a shop
and you spawn with a cobblestone ( the worst tool ) and you upgrade
so
the item in the event slot would change based on ur status?
that's why u gotta check if it's a stick or a wooden shovel
ig
oh
do you have to check for the name or is this ok
?
if {tools.%{_p}%} is 1:
set slot 13 of metadata tag "tools" of {_p} to stick of efficiency 1 named "&6&lSTICK" with lore "&a&lUPGRADE:&f 25 Sand" with all item flags
else if {tools.%{_p}%} is 2:
set slot 13 of metadata tag "tools" of {_p} to wooden shovel of efficiency 3 named "&6&lSTICK" with lore "&a&lUPGRADE:&f 1 Compressed Sand" with all item flags```
if player's inventory contains 25 sand named "&e&lSAND":
if player's inventory contains 1 cobblestone named "&7&lROCK":
remove 1 cobblestone named "&7&lROCK" from player
add 1 stick of efficiency 1 named "&6&lSTICK" with lore "&7&o2nd Tool", "&0", "&9Efficiency: &f1", "&0" and "&7&oBAD" with all item flags to player
set {tools.%{_p}%} to 2
remove 25 sand named "&e&lSAND" from player```
ye
Wait do you know how to do like From this point to this all is white stained glass pane?
what
Like set slot 1 to 26 white stained glass pane
Idk how to make that
or is that like a SkQuery thing
send the gui code?
Too big
I can send in 2 diffrent messages tho
set metadata tag "tools" of {_p} to chest inventory with 3 rows named "&b&lUPGRADES &f--> &a&lTOOLS"
set slot 0 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 1 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 2 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 3 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 4 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 5 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 6 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 7 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 8 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 9 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 10 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 11 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 12 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
if {tools.%{_p}%} is 1:
set slot 13 of metadata tag "tools" of {_p} to stick of efficiency 1 named "&6&lSTICK" with lore "&a&lUPGRADE:&f 25 Sand" with all item flags
else if {tools.%{_p}%} is 2:
set slot 13 of metadata tag "tools" of {_p} to wooden shovel of efficiency 3 named "&6&lSTICK" with lore "&a&lUPGRADE:&f 1 Compressed Sand" with all item flags```
damn
set slot 15 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 16 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 17 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 18 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 19 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 20 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 21 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 22 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 23 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 24 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 25 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
set slot 26 of metadata tag "tools" of {_p} to white stained glass pane named "&0"
open (metadata tag "tools" of {_p}) to {_p}
on inventory click:
if event-inventory = (metadata tag "tools" of player):
cancel event
if index of event-slot is 13:
if event-slot is stick named "&6&lSTICK":
if player's inventory contains 25 sand named "&e&lSAND":
if player's inventory contains 1 cobblestone named "&7&lROCK":
remove 1 cobblestone named "&7&lROCK" from player
add 1 stick of efficiency 1 named "&6&lSTICK" with lore "&7&o2nd Tool", "&0", "&9Efficiency: &f1", "&0" and "&7&oBAD" with all item flags to player
set {tools.%{_p}%} to 2
remove 25 sand named "&e&lSAND" from player```
damn
kinda large
I did 1 line for every slot..
Cus i couldnt figure out how to make like set slot <number> to slot <number> of metadata tag "tools" of player to <something> named <something> ( this is not real code i just typed it out )
idk I dont use this
I use skript-gui virtual chest inventory
ask in #skript-chat about that question