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

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

xBackpack

Member
Mar 13, 2022
4
0
1
18
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!
 
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:
on join:
    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!"

on rightclick:
    player's tool is nether star:
        name of player's tool is "&aSkyBlock Menu &7(Right Click)":
            open chest inventory with 6 rows named "SkyBlock Menu" to player
            set {_num} to 0
            loop 54 times:
                set slot {_num} of player's current inventory to gray stained glass pane named " "
                add 1 to {_num}
            # idk how to do the skull thing but that goes here

on inventory click:
    event-item is nether star:
        name of event-item is "&aSkyBlock Menu &7(Right Click)":
            cancel event
    name of player's current inventory is "Skyblock Menu":
        event-item is gray stained glass pane named " ":
            cancel event
 
Oh yes, thankyou so much! This makes a lot of sense and I can learn a lot from this! Thanks :emoji_slight_smile:
[doublepost=1647355913,1647355659][/doublepost]Oh by the way, the head thing is because of SKBee, Thanks ShaneBee!