Solved Please help me complete my skript.

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

    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.

KIMHYOCHAN

Member
May 7, 2022
1
0
1
on inventory close:
if inventory name of current inventory of player contains "PackageSetting":
set {_inv} to uncolored inventory name of current inventory of player
replace "PackageSetting" with "" in {_inv}
clear {package.set.%{_inv}%::*}
loop 54 times:
add 1 to {_player}
add slot {_player}-1 of player's current inventory to {package.set.%{_inv}%::*}

That phrase doesn't apply. Developers who know this, please comment!
My skript version is 2.5.3.
 
why are you trying to alter the inventory of a player after they have closed it? Did you mean to use "on inventory open:"?
also, you didn't set the variable {_player} to anything beforehand, so just before the loop it should be like this:
Code:
set {_number} to 1
loop 54 times:
    set slot {_player} of player's current inventory to {package.set.%{_inv}%::*}
    add 1 to {_player}
so, your final code should look something like this:
Code:
on inventory open:
    if inventory name of current inventory of player contains "PackageSetting":
        set {_inv} to uncolored inventory name of current inventory of player
        replace "PackageSetting" with "" in {_inv}
        clear {package.set.%{_inv}%::*}
        set {_number} to 1
        loop 54 times:
            set slot {_number}-1 of player's current inventory to {package.set.%{_inv}%::*}
            add 1 to {_number}

also, it might be best to use a skript-addon plugin for gui/inventory things as the default skript one is very laggy and doesn't work well. I recommend using one such as skript-gui as its fairly easy to use and it works quite well.
Finally, it would be useful to update your skript version to the latest one.

PS: Please use the insert code function so that it is clearer to see the formatting of the lines
 
Status
Not open for further replies.