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!

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

Solved I am trying to keep an item always in my inventory but it doesn't work!

Discussion in 'Requests' started by xBackpack, Mar 13, 2022.

  1. xBackpack

    xBackpack Member

    Joined:
    Mar 13, 2022
    Messages:
    4
    Likes Received:
    0
    Version: 2.6.1
    Author: Me
    Addons: SkBee (I don't think it is relevant)
    Extra Info:
    The first time I try to move it, the script stops it, but the second time the script doesn't stop it. The third time, the script stops it, the fourth time, the script doesn't stop it. Etc.

    Code:
    https://pastebin.com/fGiRwibW
    or

    every 0.01 seconds:
    loop all players:
    if slot 8 of loop-player's inventory is not nether star:
    if loop-player's inventory contains nether star named "&aSkyBlock Menu &7(Right Click)" with lore "&7View all of your SkyBlock" and "&7progress, including your Skills," and "&7Collections, Recipes, and more!" and "" and "&eClick to open!":
    remove 1 nether star from loop-player's inventory
    set slot 8 of loop-player's inventory to nether star named "&aSkyBlock Menu &7(Right Click)" with lore "&7View all of your SkyBlock" and "&7progress, including your Skills," and "&7Collections, Recipes, and more!" and "" and "&eClick to open!"
    on right click:
    if player's tool is nether star:
    if uncolored name of player's tool is "SkyBlock Menu (Right Click)":
    open chest inventory with 6 rows named "SkyBlock Menu" to player
    set slot 0 of player's current inventory to gray stained glass pane named " "
    set slot 1 of player's current inventory to gray stained glass pane named " "
    set slot 2 of player's current inventory to gray stained glass pane named " "
    set slot 3 of player's current inventory to gray stained glass pane named " "
    set slot 4 of player's current inventory to gray stained glass pane named " "
    set slot 5 of player's current inventory to gray stained glass pane named " "
    set slot 6 of player's current inventory to gray stained glass pane named " "
    set slot 7 of player's current inventory to gray stained glass pane named " "
    set slot 8 of player's current inventory to gray stained glass pane named " "
    set slot 9 of player's current inventory to gray stained glass pane named " "
    set slot 10 of player's current inventory to gray stained glass pane named " "
    set slot 11 of player's current inventory to gray stained glass pane named " "
    set slot 12 of player's current inventory to gray stained glass pane named " "
    set {playerhead} to a player head
    add "{SkullOwner:%player%}" to nbt of {playerhead}
    set slot 13 of player's current inventory to {playerhead} named "&aYour SkyBlock Profile"
    on inventory click:
    if name of event-inventory is "SkyBlock Menu":
    if index of event-slot is 13:
    send "test" to player
    else:
    cancel event

    I appreciate the help!
     
  2. Orangesanta8415

    Supporter

    Joined:
    Nov 21, 2020
    Messages:
    40
    Likes Received:
    0
    This should work, but I couldn't get the head thing to work on my end. I've also rewritten your code to be a lot more lag friendly and a lot shorter, however it is the exact same as to what you were trying to do.

    Code (Text):
    1. on join:
    2.     set slot 8 of player to nether star named "&aSkyBlock Menu &7(Right Click)" with lore "&7View all of your SkyBlock" and "&7progress, including your Skills," and "&7Collections, Recipes, and more!" and "" and "&eClick to open!"
    3.  
    4. on rightclick:
    5.     player's tool is nether star:
    6.         name of player's tool is "&aSkyBlock Menu &7(Right Click)":
    7.             open chest inventory with 6 rows named "SkyBlock Menu" to player
    8.             set {_num} to 0
    9.             loop 54 times:
    10.                 set slot {_num} of player's current inventory to gray stained glass pane named " "
    11.                 add 1 to {_num}
    12.             # idk how to do the skull thing but that goes here
    13.  
    14. on inventory click:
    15.     event-item is nether star:
    16.         name of event-item is "&aSkyBlock Menu &7(Right Click)":
    17.             cancel event
    18.     name of player's current inventory is "Skyblock Menu":
    19.         event-item is gray stained glass pane named " ":
    20.             cancel event
     
  3. xBackpack

    xBackpack Member

    Joined:
    Mar 13, 2022
    Messages:
    4
    Likes Received:
    0
    Oh yes, thankyou so much! This makes a lot of sense and I can learn a lot from this! Thanks :emoji_slight_smile:
    --- Double Post Merged, Mar 15, 2022, Original Post Date: Mar 15, 2022 ---
    Oh by the way, the head thing is because of SKBee, Thanks ShaneBee!
     
  4. Orangesanta8415

    Supporter

    Joined:
    Nov 21, 2020
    Messages:
    40
    Likes Received:
    0
    Your welcome have fun with it :emoji_slight_smile:
     

Share This Page

Loading...