Format Slot

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

  • 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.

Turb032

Active Member
Jan 16, 2020
109
0
16
21
Hi guys, i wanted to know if there's a way to format a slot of any gui, WHILE a gui is open, like this:
Code:
on inventory click:
    if inventory's name is "name":
        if clicked item's name is "aldksald":
            format slot (slot) of - #Here i want to make that when i click the item in the first inventory, another item appears WITHOUT using other commands

is this possible? Thanks!
 
I hear format slot is very buggy, therefor use Tuske GUI's or simply use set slot as I did below
Code:
#example script, I just used a command as the opening of the GUI, you could use whatever else you want


command /gui:
    trigger:
        open chest with 1 row named "Hello There" to player
        set slot 0 of player's current inventory to red wool named "&4&lRED WOOL"
        

on inventory click:
    if name of player's current inventory is "Hello There":
        cancel event
        if clicked slot is 0:
            set slot 0 of player's current inventory to magenta wool named "&d&lMAGENTA WOOL"
 
i tried copy and pasting your skript but when i click the red wool nothing happens
 
I think something is interfering with the code, becasue as said before, it worked fine for me.

How about this code?
Code:
#example script, I just used a command as the opening of the GUI, you could use whatever else you want

command /gui:
    trigger:
        open chest with 1 row named "Hello There" to player
        set slot 0 of player's current inventory to red wool named "&4&lRED WOOL"
        

on inventory click:
    if name of player's current inventory is "Hello There":
        cancel event
        if clicked slot is 0:
            set slot 1 of player's current inventory to magenta wool named "&d&lMAGENTA WOOL"
            set slot 0 of player's current inventory to air
        if clicked slot is 1:
            set slot 0 of player's current inventory to red wool named "&4&lRED WOOL"
            set slot 1 of player's current inventory to air
 
mmh no, nothing happens, if i click, the item i clicked is in my hand. I tried disabling ALL skripts and leave enabled only this one, but nop
 
is there any addon that conflicts with the skript?
make sure you got these 2 addons
upload_2020-5-16_20-8-6.png
 
yes i have them
then you should debug your skript addons

do this by adding ".disabled" in the jar file name. ex "SkQuery-4.1.1.jar" = "SkQuery-4.1.1.jar.disabled"
then restart your server, and test it out.

Also note, that after confirming a addon is not the cause, you can just remove the ".disabled", and then move on to the next addon.
 
ok did it, but nothing happens xD, oh also, the plugin isn't disabled..
 
i've gone into "plugins" folder, i clicked "Rename" on the plugin .jar (SkQuery-4.1.2 (1)) and renamed it with "SkQuery-4.1.2 (1).disabled"
 
i've gone into "plugins" folder, i clicked "Rename" on the plugin .jar (SkQuery-4.1.2 (1)) and renamed it with "SkQuery-4.1.2 (1).disabled"
SkQuery was just an example of how you would debug an addon.

You should do this with all your addons, to see if any addon is the cause of this weird behaviour of my code.
[doublepost=1589653603,1589653570][/doublepost]Also remember to restart your server each and every time
 
Status
Not open for further replies.