Solved how to add a players inv slot to a list variable

  • 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 community!

    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!

timbercat10

Member
Jul 10, 2023
45
0
6
how to add a players inv slot to a list variable


command potato:
trigger
add slot 0 of player's inventory to {test::*}
send "%{test::*}%" to player

output: air


slot 0 has a diamond in it
 
hey, you can do it like this:
Code:
command /potato:
    trigger:
        set {test::*} to slot 0 of player's inventory
        send "%{test::*}%" to player
 
If you want to get the first slots item then you can do
Code:
slot 0 of player's inventory

If you want set a slot to a item from a variable then you can do
Code:
set slot 0 of player's inventory to {your variable}

If you want to save the entire INVENTORY (not armor or offhand) of the player then you can do
Code:
clear {your list::*}
loop (9 * 5) times:
  set {_slot} to loop-number
  set {your list::%{_slot}%} to slot {_slot} of player's inventory
 
You can do
Code:
add slot 0 of player's inventory to {test::*}

To clear the list again you can do
Code:
clear {test::*}