Inventory Help

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

    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!

Sulsayhl

Active Member
Mar 11, 2024
59
1
8
24
Whenever I create an inventory and i click something that executes a command or sends a message or gives an item to a player. The server wont let you put i tems in your inventory , whenever you right click on a block or click on something it executes the same command the on inventory click event did. I dont know what it is. Please help
 
Did you make sure to only cancel on inventory click events in that inventory? Your description of your issue seems to be saying that using this inventory breaks all further inventory interactions.
 
I canceled the event after, here is a example.

Code:
command /gui:
    trigger:   
        open chest inventory with 3 rows named "&8GUI" to player
        set slot 1 of player's current inventory to stone named "&dSTONE" with lore "&eClick!"
        
on inventory click:
    if name of player's current inventory is "&8GUI":
        clicked slot is 1: #I just realized i forgot to add this
            send "&aYou clicked stone!" to player
            cancel event

I just realized i forgot to add "clicked slot is "#", maybe that should resolve the problem, or it could be the Cancel Event.
Also congrats on Supporter++
 
Wait, so is "clicked slot" the problem, or is it cancel event? Because it like confuses the whole server and like it wont let you put blocks in your inventory, the guis mix with eachother. Its weird Maybe I should try the "clicked slot" event. I also don't want players putting the gui items in there inventory, thats why i add cancel
event maybe thats the problem. Its just super weird.
 
I think I understand what you mean. Change
name of player's current inventory
to
name of event-inventory

That way, it won't cancel when they're just clicking in their inventory. The way you had it set up, any inventory click event (in their inventory or otherwise) would be cancelled while the GUI was open.