1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Unstealable slots are stealable

Discussion in 'Skript' started by math0898, May 19, 2021.

Thread Status:
Not open for further replies.
  1. math0898

    math0898 Member

    Joined:
    May 19, 2021
    Messages:
    1
    Likes Received:
    0
    Skript Version: 2.5.3
    Server Version: 1.16.5
    Problem Code:
    Code (Text):
    1. function fill(user:player, slots:number, filler:item = gray stained glass pane):
    2.         set name of {_filler} to " "
    3.         set {_i} to 0
    4.         while {_i} is less than {_slots}:
    5.                 format slot {_i} of {_user} with {_filler} to be unstealable
    6.                 add 1 to {_i}
    7.  
    8. command /questlog <text="none">:
    9.         aliases: /quests
    10.         permission: skript.rpg.questlog
    11.         trigger:
    12.                 wait 0.1 seconds
    13.                 if arg-1 is "none":
    14.                         open chest with 3 rows named "Quest Log" to player
    15.                         fill(player, 27)
    16.  
    17.                         set {_abyss faction} to an eye of ender named "&8[&2Abyss Faction&8]"
    18.                         set the 1st line of lore of {_abyss faction} to "&7Information about standing and quests"
    19.                         set the 2nd line of lore of {_abyss faction} to "&7completed for the Abyss faction."
    20.  
    21.                         set {_elemental faction} to blaze powder named "&8[&2Elemental Faction&8]"
    22.                         set the 1st line of lore of {_elemental faction} to "&4Coming soon."
    23.  
    24.                         format slot 10 of player with {_abyss faction} to close then run [execute player command "/questlog abyss"]
    25.                         set slot 12 of player's current inventory to {_elemental faction}
    26.  
    27.                 else if arg-1 is "abyss":
    28.                         open chest with 3 rows named "Abyss Faction" to player
    29.                         fill(player, 27)
    30.  
    31.                         set {_reputation} to a emerald named "&8[&dReputation&8]&7 %{rpg.%uuid of player%.abyss.reputation}%"
    32.                         set {_go back} to a arrow named "&8<- &7Go Back"
    33.  
    34.                         set slot 22 of player's current inventory to {_reputation}
    35.                         format slot 26 of player with {_go back} to close then run [execute player command "/questlog"]
    36.                 else:
    37.                         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.
    --- Double Post Merged, May 19, 2021, Original Post Date: May 19, 2021 ---
    --- Double Post Merged, May 19, 2021 ---
    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.
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...