I need some help with a 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 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.
Jul 14, 2022
1
0
1
23
I am trying to make a "Wallet". Where right clicking on the wallet opens a shulker box GUI. I want the skript so players can only drag gold nuggets named Gold Coins into the GUI. I can easily change textures, so if you need the Wallet item to be a shulker box, it's no problem.
 
Hey there.

Code:
function wallet(p: player):
    open virtual chest inventory named "Wallet" with size 3 to {_p}  #Change the name here but u will have to change the name accordingly on line 15 and 19
    set {_slot} to 0
    loop 26 times:  #Loading saved inventory
        set slot {_slot} of current inventory of {_p} to {chest::%{_slot}%::%{_p}%}
        add 1 to {_slot}
           
function savewallet(p: player):
    set {_slot} to 0
    loop 26 times: #Saving inventory
        set {chest::%{_slot}%::%{_p}%} to slot {_slot} of current inventory of {_p}
        add 1 to {_slot}
       
on inventory close: #Saves the content when closing the inv
    if event-inventory's name contains "Wallet":
        savewallet(player)
 
on rightclick with oak planks: #Loads the content when opening the wallet DONT FORGET TO CHANGE YOUR ITEM TYPE HERE INSTEAD OF "oak planks"
    if event-item's name contains  "Wallet":
        wallet(player)

As stated in the code, dont forget to change what u need to change, also I wasnt sure what u meant by shulker box since its just a chest of 3 row so maybe I've done things wrong
 
Last edited:
Status
Not open for further replies.