Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

set variable to all items of gui-inventory not working #47

Closed
melinstagibson opened this issue Feb 13, 2018 · 3 comments
Closed

set variable to all items of gui-inventory not working #47

melinstagibson opened this issue Feb 13, 2018 · 3 comments

Comments

@melinstagibson
Copy link

So this is weird bug:
Im trying to do this to create kits:

command /editkit <string>:
        permission: mel.createkit
        trigger:
                if gui "%arg-1%" is set:
                        open gui "%arg-1%" to player
                else:
                        create gui "%arg-1%" with virtual chest named "&2Edit Kit ""&a&l%arg-1%&2""":
                                run when close the gui:
                                        set {kit::%arg-1%::*} to all items of gui-inventory
                        open last created gui to player

But it doesnt seem to work (variable isnt being set) if i use %arg-1% in the variable name.
if i, instead, do it like this:

set {kit::test::*} to all items of gui-inventory

it works

I tried it without gui-inventory to see if its a skript issue but this:

command /testkit <string>:
    permission: *
    trigger:
        set {kit::%arg-1%::*} to all items in player's inventory

works aswell so its a TuSke issue

@melinstagibson
Copy link
Author

melinstagibson commented Feb 13, 2018

Edit:
the arg-1 isn't carried over to the run when close part of the skript it seems, doing this:

command /editkit <string>:
        permission: mel.createkit
        trigger:
                set {arg-1} to arg-1
                if gui "%arg-1%" is set:
                        open gui "%arg-1%" to player
                else:
                        create gui "%arg-1%" with virtual chest named "&2Edit Kit ""&a&l%arg-1%&2""":
                                run when close the gui:
                                        set {kit::%{arg-1}%::*} to all items of gui-inventory
                        open last created gui to player

works as workaround
(i set a variable {arg-1} to arg-1 and used that instead)

@Blueyescat
Copy link

Blueyescat commented Feb 18, 2018

Already you have to do that with the current system. You should read the wiki 🙂

https://github.com/Tuke-Nuke/TuSKe/wiki/GUI-Manager#things-you-need-to-know
image

So you should close the issue.

@melinstagibson
Copy link
Author

Weird, last time i tried it didnt work with temporary variables either but ill try again, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants