Skript: checking name of inventory isn't work [NOT AN ISSUES :x]

Created on 7 Mar 2019  ·  5Comments  ·  Source: SkriptLang/Skript

Description

Hello when i want check name's inventory is wont work

Steps to Reproduce

command /testgui:
trigger:
open virtual hopper inventory with size 1 named "&8●&r &4&lOptions &8●" to player
if name of current inventory of player contain "&8●&r &4&lOptions &8●":
if {fb.%player%} is set:
set {_fb} to "&c&lDésactivé&r"
else:
set {_fb} to "&a&lActif&r"
make a gui slot 0 of {_player} with item frame item named "&8✖ &6Désactiver le tableau de droite? &8✖" with lore "&8&m------------------------------", "&8➜ &2clique ici pour &al'activer&7/&cdésactiver", "&8➜ &7Etat du tableau: %{_fb}%" to run {_player} command "/statistiques toggle"

Expected Behavior

In normal case item seems appear in gui but here he won't

Errors / Screenshots

None error in console or in game

Server Information

  • Server version/platform: CraftBukkit version git-Spigot-f56e2e7-9dc5658 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)

  • Skript version: Lastest

Additional Context

Thanks to read me :)

All 5 comments

Try
current inventory's name = "&8●&r &4&lOptions &8●"

Okay first of all i formatted your code in this block so its readable

command /mabite:
    trigger:
        open virtual hopper inventory with size 1 named "&8●&r &4&lOptions &8●" to player
            if name of current inventory of player contain "&8●&r &4&lOptions &8●":
                if {fb.%player%} is set:
                    set {_fb} to "&c&lDésactivé&r"
                else:
                    set {_fb} to "&a&lActif&r"
                    make a gui slot 0 of {_player} with item frame item named "&8✖ &6Désactiver le tableau de droite? &8✖" with lore "&8&m------------------------------", "&8➜ &2clique ici pour &al'activer&7/&cdésactiver", "&8➜ &7Etat du tableau: %{_fb}%" to run {_player} command "/statistiques toggle"

Second of all, why are you checking for the name of the inventory when you literally just opened it with a name?
If you are using Tuske to open an inventory there is absolutely no need to check the name of the inventory, it literally CANT be anything else.

Third, your biggest issue here is this

make a gui slot 0 of {_player}

You never once set {_player}

Long story short, this is NOT an issue with Skript but rather a user error and not writing your script properly.

I recommend asking for help via one of the Skript Discords first before posting an issue, especially when these are not issues with the Skript plugin.

Ehh, just to clarify, that piece of code the OP posted should work regardless of how well it was written. The issue is at the server level (Spigot/Minecraft issue) so there's nothing we can do about it. You're probably better off reporting it to Spigot/Paper, the actual issue is that unnecessary color codes get removed from the title.

Ehh, just to clarify, that piece of code the OP posted should work regardless of how well it was written. The issue is at the server level (Spigot/Minecraft issue) so there's nothing we can do about it. You're probably better off reporting it to Spigot/Paper, the actual issue is that unnecessary color codes get removed from the title.

I beg to differ. They are setting a slot to {_player} when {_player} is never set, so that is a big reason why the item isnt showing up in the gui

Okay i don't post it correctly firstable, i'm sorry about that and if {_player} is in my code it's cause in my full code i use it, if i don't use BBCode, the cause is with some script syntax he's become broken sometimes ;/

So after checked with a clearly test code i see it work so sorry for the disturbance but it's not a issues

command /testgui: #imagine this command is a core function
    trigger:
        open virtual hopper inventory with size 1 named "Options" to player
        make a gui slot 0 of player with item frame item named "&8✖ Yes i'm open &8✖" with lore "&9yesyesyes" to run player command "/testcommandwithoutguiopeninit"

command /testcommandwithoutguiopeninit: #imagine this command is a command executable by player outside of gui but with this condition we know when player is in a GUI
    trigger:
        message "Content outside of gui like give or somethink" to player
        if name of current inventory of player is "Options":    
            make a gui slot 0 of player with glowing diamond item named "&8✖ &cYES IT WORK &8✖" with lore "YES NAME INVENTORY IS", "DETECTED OUTSIDE OF HIM" to run player command "/testcommandwithoutguiopeninit"

PS: okay the true balise code work like discord and she's not in the bar for formating text :c
PPS: sorry if my english is not perfect or bad i'm french and i don't speak english at all since any years so u.u

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrScopes picture MrScopes  ·  3Comments

wohahobg picture wohahobg  ·  3Comments

Misio12320 picture Misio12320  ·  3Comments

Romitou picture Romitou  ·  3Comments

ghost picture ghost  ·  3Comments