1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Inventory Name

Discussion in 'Skript' started by rustedst, May 16, 2020.

Thread Status:
Not open for further replies.
  1. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    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?

     
  2. Best Answer:
    Post #8 by rustedst, May 17, 2020
  3. send over your full code
     
  4. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    It contains 995 lines. You sure?
     
  5. No, then just send the relevant part.
     
  6. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    It's hard to do it, I'll write an example code just same as mine:
    Code (Text):
    1. on event1:
    2.     open chest inventory with 3 rows named "&4invname" to player
    3. on inventory click:
    4.     if if event-inventory's name = "&4invname": #I tried every expression of inventory name, this is the last one I tried.
    5.         do something
    And it doesn't do "something".
     
  7. Madrid

    Supporter

    Joined:
    May 5, 2017
    Messages:
    6
    Likes Received:
    0
    Try using if display name of player's current inventory is "&4invname":emoji_slight_smile:
    Pretty sure "display" isn't needed but oh well ¯\_(ツ)_/¯
     
  8. I think you also have to check for clicked slot
     
  9. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    Didn't work, same thing happened :emoji_frowning:
    I already do, but the problem is with inventory name, I tested it with a new script that only checks inventory name.
    --- Double Post Merged, May 17, 2020, Original Post Date: May 17, 2020 ---
    I tried that:
    Code (Text):
    1. on inventory click:
    2.     wait 5 seconds
    3.     set {_a} to display name of player's current inventory
    4.     send "%{_a}%" to player
    And it sends "<none>"
    --- Double Post Merged, May 17, 2020 ---
    https://github.com/SkriptLang/Skript/pull/2094

    I saw this sharing of ShaneBee, but couldn't understand how I can make use of it.
    --- Double Post Merged, May 17, 2020 ---
    Solved. I did that with skript-mirror:
    Code (Text):
    1. on event1:
    2.     open chest inventory with 3 rows named "&4invname" to player
    3. on inventory click:
    4.     set {_i} to event.getView()
    5.     set {_n} to {_i}.getTitle()
    6.     if {_n} is "&4invname":
    7.         do something
     
Thread Status:
Not open for further replies.

Share This Page

Loading...