#inventory click
1 messages · Page 1 of 1 (latest)
amount of ...
What?
like you already have in your code..
but add the plain part so it only detects items without any extra NBT
if clicked slot is 12:
set {block1} to clicked slot
set {naam1} to name of {block1}
set {naam2} to clicked slot
plain {naam2}
send "%{naam1}%"
send "%{naam2}%"
set {_lore1} to numbers of uncoloured line 1 of {block1}'s lore parsed as a number
if "%click type%" contains "LEFT":
set {_aantal1} to amount of {naam2} in player's inventory
if {_aantal1} is bigger than 0:
remove 1 of {_aantal1} from player's inventory
doesn't work..
x8ight suggests that you read this embed
Code blocks make it easier for helpers to identify potential errors -- help them help you!
```vb
on chat:
broadcast "This is how you format code!"
```
on chat:
broadcast "This is how you format code!"
On US keyboards, the grave character (`) is located above the tab key on the top left of the keyboard

do i need to use, plain "%{naam2}%"?
no
How than
I'am trying to solve this for a couple of hours, but it didn't worked so well
- format your code

How do you mean format your code
.
on inventory click:
if name of player's current inventory is "&8Quickshop":
cancel event
if clicked slot is 12:
set {block1} to clicked slot
set {naam1} to name of {block1}
set {naam2} to {block1}
plain {naam2}
send "%{naam1}%"
set {_lore1} to numbers of uncoloured line 1 of {block1}'s lore parsed as a number
if "%click type%" contains "LEFT":
set {_aantal1} to amount of {naam2} in player's inventory
if {_aantal1} is bigger than 0:
remove 1 of {_aantal1} from player's inventory
This is the whole code
cool
But, how do i set {naam2} to the clicked slot without any lore?
- You have not formatted the code
- you have not done what I told you to do
- if you want the
event-slot(notclicked slot), you can also literally use that expression
how do i format it than? I cant really understand what you mean man
i just want a variable without any lore
format your code, in discord
read that
should look like this```
if name of player's current inventory is "&8Quickshop":
cancel event
if event-slot is 12:
set {block1} to event-slot
set {naam1} to name of {block1}
set {naam2} to {block1}
plain {naam2}
send "%{naam2}%"
set {_lore1} to numbers of uncoloured line 1 of {block1}'s lore parsed as a number
if "%click type%" contains "LEFT":
set {_aantal1} to amount of {naam2} in player's inventory
if {_aantal1} is bigger than 0:
remove 1 of {_aantal1} from player's inventory```
🎉
now, you can literally use the event-slot expression (you should also be using index of event-slot = 12)
and then combine that with plain for plain event-slot...
its not an effect
How than?
its an expression
set {naam2} to event-slot plain {naam2} send "%{naam2}%"
no
set it to the expression
and honestly these variable should be local but i dont think they are needed at all
Can you don't change this to how it needed to be and working?
That is 10times easier
im not here to write code for you
Can you than tell me please how to make it working
I literally already did
♥️ I solved it! thanksss you!