- Depends addon: Skript Reflect
Code:
command x:
trigger:
create chest inventory 2 rows title "xyz" to player
set gui player slot of 3,17 item grass named "x" with action not close
set gui player slot of 4 item sand named "y" with action close
set gui player slot of 5 item diamond_sword named "x" with action close and run player command "cmd"
set gui player slot of 6 item iron_sword named "x" with action close and run console command "say hello"
set gui player slot of 7 item wooden_sword with lore "y" with action player command "cmd"
set gui player slot of 8 item golden_sword named "x" with lore "y" with action console command "say hello"
set gui player slot of 9 item golden_sword named "x" with lore "y" with action run function "functionname"(player, "hello")
set gui player slot of 10 item diamond_pickaxe named "x" with lore "y" with action close and run function "functionname"(player, "hello")
Code:
- set {_x} to item slot of %number% from %player%'s virtual (gui|inventory)
- set {_y} to title of %player%'s virtual (gui|inventory)
- close %player%'s virtual (gui|inventory)
- remove item slot of %number% from %player%'s virtual (gui|inventory)