Skip to content

Clicked inventory not working within on inventory click #2415

Description

@JeroenoBoy

Description

I tried to make a gui, but when i came to the inventory part, nothing happend, so i did a lil debugging and nothing worked, it all showed up as in the on inventory click, the function fillinventory was working fine

Steps to Reproduce

command /shop:
	trigger:
		openShop(player)
		play sound "ui.button.click"


function openShop(P: player, s: string = "MM"):

	if {_s} = "MM":
		open chest inventory with 6 rows named "Shop" to {_P}
		fillinventory({_P})


function fillinventory(P: player):
	set {_S} to rows of {_P}'s current inventory
	loop {_S}*9 times:
		set slot loop-value -1 of {_P}'s current inventory to light gray stained glass pane named " &a "


on inventory click:
	broadcast "hi"
	set {_S} to clicked inventory
	set {_B} to player's current inventory
	if {_S} = "Shop":
		broadcast "1"
	if name of {_S} = "Shop":
		broadcast "2"
	if {_B} = "Shop":
		broadcast "3"
	if name of {_B} = "Shop":
		broadcast "4"
	if name of clicked inventory = "Shop":
		broadcast "5"
	if name of player's current inventory = "Shop":
		broadcast "6"

Expected Behavior

I expected a 4 messages: "2", "4", "5", "6" when i click the gui

Errors / Screenshots

Takes you to Gyazo.com

Server Information

  • Server version/platform: 1.14.4 paper build 176
  • Skript version: Skript 2.4 beta 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions