Solved Unstealable slots are stealable

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

math0898

Member
May 19, 2021
1
0
1
28
Skript Version: 2.5.3
Server Version: 1.16.5
Problem Code:
Code:
function fill(user:player, slots:number, filler:item = gray stained glass pane):
        set name of {_filler} to " "
        set {_i} to 0
        while {_i} is less than {_slots}:
                format slot {_i} of {_user} with {_filler} to be unstealable
                add 1 to {_i}

command /questlog <text="none">:
        aliases: /quests
        permission: skript.rpg.questlog
        trigger:
                wait 0.1 seconds
                if arg-1 is "none":
                        open chest with 3 rows named "Quest Log" to player
                        fill(player, 27)

                        set {_abyss faction} to an eye of ender named "&8[&2Abyss Faction&8]"
                        set the 1st line of lore of {_abyss faction} to "&7Information about standing and quests"
                        set the 2nd line of lore of {_abyss faction} to "&7completed for the Abyss faction."

                        set {_elemental faction} to blaze powder named "&8[&2Elemental Faction&8]"
                        set the 1st line of lore of {_elemental faction} to "&4Coming soon."

                        format slot 10 of player with {_abyss faction} to close then run [execute player command "/questlog abyss"]
                        set slot 12 of player's current inventory to {_elemental faction}

                else if arg-1 is "abyss":
                        open chest with 3 rows named "Abyss Faction" to player
                        fill(player, 27)

                        set {_reputation} to a emerald named "&8[&dReputation&8]&7 %{rpg.%uuid of player%.abyss.reputation}%"
                        set {_go back} to a arrow named "&8<- &7Go Back"

                        set slot 22 of player's current inventory to {_reputation}
                        format slot 26 of player with {_go back} to close then run [execute player command "/questlog"]
                else:
                        send "unkown param" to player
Problem Behavior: No errors but when opening a second UI from the first, either main -> Abyss Faction or Abyss Faction -> main the items are stealable despite using the same fill() function. The first opened section the items are correctly not stealable.
Addons: SkQuery 4.1.3
Troubleshooting: I've tried commenting out all lines except fill(player,27) under the abyss faction to the same result as well as adding a separate function to run through and lock all the items after fill() runs which resulted in the same behavior.
Docs?: There is a little information on format gui from SkUnity and SkriptHub but nothing specific on stealable which I believe my issue here is with.
Have you searched the forums?: A little bit. Most solutions involve switching off of SkQuery to Tusuke because 'GUI's are buggy in SkQuery' but I'm not sure if this will cause issues with existing code.
[doublepost=1621400076,1621399940][/doublepost]
Skript Version: 2.5.3
Server Version: 1.16.5
Problem Code:
Code:
function fill(user:player, slots:number, filler:item = gray stained glass pane):
        set name of {_filler} to " "
        set {_i} to 0
        while {_i} is less than {_slots}:
                format slot {_i} of {_user} with {_filler} to be unstealable
                add 1 to {_i}

command /questlog <text="none">:
        aliases: /quests
        permission: skript.rpg.questlog
        trigger:
                wait 0.1 seconds
                if arg-1 is "none":
                        open chest with 3 rows named "Quest Log" to player
                        fill(player, 27)

                        set {_abyss faction} to an eye of ender named "&8[&2Abyss Faction&8]"
                        set the 1st line of lore of {_abyss faction} to "&7Information about standing and quests"
                        set the 2nd line of lore of {_abyss faction} to "&7completed for the Abyss faction."

                        set {_elemental faction} to blaze powder named "&8[&2Elemental Faction&8]"
                        set the 1st line of lore of {_elemental faction} to "&4Coming soon."

                        format slot 10 of player with {_abyss faction} to close then run [execute player command "/questlog abyss"]
                        set slot 12 of player's current inventory to {_elemental faction}

                else if arg-1 is "abyss":
                        open chest with 3 rows named "Abyss Faction" to player
                        fill(player, 27)

                        set {_reputation} to a emerald named "&8[&dReputation&8]&7 %{rpg.%uuid of player%.abyss.reputation}%"
                        set {_go back} to a arrow named "&8<- &7Go Back"

                        set slot 22 of player's current inventory to {_reputation}
                        format slot 26 of player with {_go back} to close then run [execute player command "/questlog"]
                else:
                        send "unkown param" to player
Problem Behavior: No errors but when opening a second UI from the first, either main -> Abyss Faction or Abyss Faction -> main the items are stealable despite using the same fill() function. The first opened section the items are correctly not stealable. The links to other UI also don't work.
Addons: SkQuery 4.1.3
Troubleshooting: I've tried commenting out all lines except fill(player,27) under the abyss faction to the same result as well as adding a separate function to run through and lock all the items after fill() runs which resulted in the same behavior.
Docs?: There is a little information on format gui from SkUnity and SkriptHub but nothing specific on stealable which I believe my issue here is with.
Have you searched the forums?: A little bit. Most solutions involve switching off of SkQuery to Tusuke because 'GUI's are buggy in SkQuery' but I'm not sure if this will cause issues with existing code.
[doublepost=1621400216][/doublepost]Wish I could delete this forum post now :? Anyways Skript is not all powerful... don't send it a ton of things to do 0.1 seconds after one another. Without a delay the UI fails to open at all so idk why it surprised me having a really low delay would cause other issues. For now a 0.5 second delay causes things to behave as intended now I'm going to test if a lower delay works.
 
You already wrote the solution: A little bit. Most solutions involve switching off of SkQuery to Tusuke because 'GUI's are buggy in SkQuery' but I'm not sure if this will cause issues with existing code.

But you better use Vanilla GUIs.
 
Status
Not open for further replies.