Solved Inventory Name

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

Status
Not open for further replies.

rustedst

Active Member
Apr 24, 2020
97
4
8
22
Istanbul, Turkey
I have this script which does something if the event-inventory's name is "example". But it doesn't seem to detect the name of inventory. I have SkQuery and my version is 1.14.4. It doesn't give an error, but it doesn't do anything although the event-inventory's name is "example". Is there a problem with 1.14.4 and SkQuery inventory names?
 
It's hard to do it, I'll write an example code just same as mine:
Code:
on event1:
    open chest inventory with 3 rows named "&4invname" to player
on inventory click:
    if if event-inventory's name = "&4invname": #I tried every expression of inventory name, this is the last one I tried.
        do something
And it doesn't do "something".
 
Try using if display name of player's current inventory is "&4invname":emoji_slight_smile:
Pretty sure "display" isn't needed but oh well ¯\_(ツ)_/¯
 
Try using if display name of player's current inventory is "&4invname":emoji_slight_smile:
Pretty sure "display" isn't needed but oh well ¯\_(ツ)_/¯
Didn't work, same thing happened :emoji_frowning:
I think you also have to check for clicked slot
I already do, but the problem is with inventory name, I tested it with a new script that only checks inventory name.
[doublepost=1589705652,1589705446][/doublepost]I tried that:
Code:
on inventory click:
    wait 5 seconds
    set {_a} to display name of player's current inventory
    send "%{_a}%" to player
And it sends "<none>"
[doublepost=1589705973][/doublepost]https://github.com/SkriptLang/Skript/pull/2094

I saw this sharing of ShaneBee, but couldn't understand how I can make use of it.
[doublepost=1589707364][/doublepost]Solved. I did that with skript-mirror:
Code:
on event1:
    open chest inventory with 3 rows named "&4invname" to player
on inventory click:
    set {_i} to event.getView()
    set {_n} to {_i}.getTitle()
    if {_n} is "&4invname":
        do something
 
Status
Not open for further replies.