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!
Skript Version: 2.2-dev25
Minecraft Version: 1.10.2
Hey! I'm trying to make a skript where if a player clicks on the slot "2" in his/her's inventory it won't move. How could I do this?
on inventory click:
inventory name of current inventory of player is "NAME OF GUI YOU CREATE WITH TuSKe":
clicked slot is 2:
cancel event
@Hobbit41 he wants the inventory to be their own inventory, not a chest gui or anything of the sort.
code_language.skript:on inventory click: name of clicked item is "name of your item" cancel event #do stuff?
Most of the time I just compare with the item name. It's better.
That won't work for me because my plugin constantly changes the item name but not the slot so yeah..so even for own inventory solution is the same
Right now i don't remember how exactly, but:That won't work for me because my plugin constantly changes the item name but not the slot so yeah..
on inventory click:
clicked slot is 2
cancel event
on inventory click:
clicked inventory is PLAYER
clicked slot is 2
cancel event
Doesn't work. I get no errors but I can still move it.Right now i don't remember how exactly, but:
The problem here is the fact that you're blocking slot 2 from being interacted with. It can easily be done with:
code_language.skript:on inventory click: clicked slot is 2 cancel event
The problem with this syntax is that it will also block you from interacting with any chest's second slot, too. To avoid such thing from happening you also have to add the "clicked inventory" syntax (Skellett)
As you can see, SkStuff also has it, but it's broken. So, instead, you use skellett one. It should work like this:
code_language.skript:on inventory click: clicked inventory is PLAYER clicked slot is 2 cancel event
The problem with this code is that i don't know if PLAYER is what clicked inventory returns if you clicked your inventory. It may be CRAFTING for what i remember, or even your name, you know.
Test it a little, it sure works this way but i'm not certain and can't look it up right now.
Then use my code above and add a debug text message "%clicked inventory%" to check what it returns, because it's most likely what i told you.Doesn't work. I get no errors but I can still move it.
Thats not what he was demanding.I know this is late but for anyone still wondering i did this
So people with that permission can still like build in spawn and stuff.Code:on inventory click: if player doesn't have permission "moveinv": cancel event
@Hobbit41 he wants the inventory to be their own inventory, not a chest gui or anything of the sort.
code_language.skript:on inventory click: name of clicked item is "name of your item" cancel event #do stuff?
Most of the time I just compare with the item name. It's better.
https://forums.skunity.com/threads/vanilla-guis.8939/#post-39122It gives me an error "item is not an item type"
It gives me an error "item is not an item type"
on inventory click:
if name of event-item is "NAME":
//SOME ACTIONS