Solved Moveble items in GUI

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

    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.

Marto_0

Member
Jul 14, 2017
15
1
3
When im opening my shop. i made. I can move around the items i put in. Any way of fixing this?. I cant move the light gray panes. But i can move the ores. And they will be back when i re-open the shop.
upload_2017-8-16_19-0-49.png
No errors
 
Please replace the options in your code by what they actually point to. The issue comes from here for all you know.
 
Now i can move every item in the gui around.
View attachment 1108
tuske by default should make the item do nothing and be unmovable when clicked, so you don't need the "do nothing" portion. That's likely not the problem though, so could you put that code in a code box or pastebin? I would like to test it but really do not want to type all that outXD
You should also include your skript and tuske versions
 
That's why i never ever use addons to format slots.

If you give up on this and want an easy solution:
code_language.skript:
set slot 0 of current inventory of player to stone named "haha lol"
then use an inventory click event...
code_language.skript:
on inventory click:
    inventory name of player's current inventory is "name of gui"
    name of clicked item is "name"
    #do stuff
    #or cancel event, if you want the item to "do nothing"

This uses SkQuery if i'm not mistaken...
 
tuske by default should make the item do nothing and be unmovable when clicked, so you don't need the "do nothing" portion. That's likely not the problem though, so could you put that code in a code box or pastebin? I would like to test it but really do not want to type all that outXD
You should also include your skript and tuske versions
I use 1.8.8. With skript version: 2.2-dev25 and TuSKe version: 1.8.1 (Not 100% sure abaut TuSKe)
https://pastebin.com/cku2PsT8







That's why i never ever use addons to format slots.

If you give up on this and want an easy solution:
code_language.skript:
set slot 0 of current inventory of player to stone named "haha lol"
then use an inventory click event...
code_language.skript:
on inventory click:
    inventory name of player's current inventory is "name of gui"
    name of clicked item is "name"
    #do stuff
    #or cancel event, if you want the item to "do nothing"

This uses SkQuery if i'm not mistaken...



Thanks! i will try that right now
[doublepost=1502910599,1502909441][/doublepost]
That's why i never ever use addons to format slots.

If you give up on this and want an easy solution:
code_language.skript:
set slot 0 of current inventory of player to stone named "haha lol"
then use an inventory click event...
code_language.skript:
on inventory click:
    inventory name of player's current inventory is "name of gui"
    name of clicked item is "name"
    #do stuff
    #or cancel event, if you want the item to "do nothing"

This uses SkQuery if i'm not mistaken...
Ok so ive done this. And the weird thing: I can still take stuff out of it. Or move it. I have asked other people. They could also take stuff out of it. Many other GUI's that are active on my server. Just work fine.
 
I use 1.8.8. With skript version: 2.2-dev25 and TuSKe version: 1.8.1 (Not 100% sure abaut TuSKe)
https://pastebin.com/cku2PsT8











Thanks! i will try that right now
[doublepost=1502910599,1502909441][/doublepost]
Ok so ive done this. And the weird thing: I can still take stuff out of it. Or move it. I have asked other people. They could also take stuff out of it. Many other GUI's that are active on my server. Just work fine.
setting a lot will make it takeable, if you're not using tuske you'd have to do
format slot 0 of player's current inventory to stone named "haha lol" to be unstealable
 
format slot 0 of player's current inventory to stone named "haha lol" to be unstealable
format slot is completely broken and its not recommended in any way because it can do anything from formating it correctly to completely messing your entire inventory up.

Ok so ive done this. And the weird thing: I can still take stuff out of it. Or move it. I have asked other people. They could also take stuff out of it. Many other GUI's that are active on my server. Just work fine.

So you used something like this, i take it?
code_language.skript:
on inventory click:    
    inventory name of player's current inventory is "name of gui"
    name of clicked item is "name"
    cancel event
And it does still allow you to take items out of the inventory?

If the inventory name is not the string you provided on the code, it won't work at all. Everything including color codes and format codes need to be completely identical, same spaces and stuff.

To test, try adding message "test" after the first condition check. If you don't receive "test" after clicking an item in your gui its because the inventory name is not the string you provided.
 
Thanks everyone for the help! I dont know how or why. But after reloading my server. It worked. (Ive done /sk reload all. So i dont know why it worked after reload) Really weird it didnt work. And works after reload. Sorry for sort of waisting your time. But thanks for helping! o3o
 
  • Like
Reactions: Wynnevir
Status
Not open for further replies.