Hello, can anyone help me?

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

number52091

Member
Feb 24, 2024
14
0
1
29
I'm new to this skript plugin, and I have a question, How do I create my own gui for each player? like a backpack.
I have an idea of how to make a basic gui, but not for each player, as if it were an ender chest.
 
this should work for a /backpack command but it still shows how to use gui's and how to save them :emoji_slight_smile:
Code:
on join:
    if {backpack::%player's uuid%::*} is not set:
        set {backpack::%player's uuid%::*} to air

command backpack:
    trigger:
        set {_gui} to a new chest inventory with 4 rows named "Backpack"
        set {_slot} to 0
        loop {backpack::%player's uuid%::*}:
            set slot {_slot} of {_gui} to loop-value
            set {_slot} to {_slot} + 1
        open {_gui} to player

on inventory close:
    if name of event-inventory is "Backpack":
        delete {backpack::%player's uuid%::*}
        loop all items in event-inventory:
            add loop-value to {backpack::%player's uuid%::*}
 
this should work for a /backpack command but it still shows how to use gui's and how to save them :emoji_slight_smile:
Code:
on join:
    if {backpack::%player's uuid%::*} is not set:
        set {backpack::%player's uuid%::*} to air

command backpack:
    trigger:
        set {_gui} to a new chest inventory with 4 rows named "Backpack"
        set {_slot} to 0
        loop {backpack::%player's uuid%::*}:
            set slot {_slot} of {_gui} to loop-value
            set {_slot} to {_slot} + 1
        open {_gui} to player

on inventory close:
    if name of event-inventory is "Backpack":
        delete {backpack::%player's uuid%::*}
        loop all items in event-inventory:
            add loop-value to {backpack::%player's uuid%::*}
Thx Bro!
It solved my problem, but I have one more question, I have another question on skript, should I ask for help again by creating another page? Or can you help me XD?
 
I can help you
Oh Thx! well, When clicked, the diamond does an action, So far so good, But all the other slots also do the same action when I click on any of them, How do I make it so that only the diamond is clickable?

2024-02-25_07.17.20.png
 
this should explain how to use inventory clicks for different slots
Code:
command gui:
    trigger:
        set {_gui} to a new chest inventory with 1 row named "Testing XD"
        set slot 0 of {_gui} to diamond named "Testing"
        open {_gui} to player

on inventory click:
    if name of event-inventory is "Testing XD":
        if index of event-slot is 0:
            send "IDK" to player
            cancel event
#or
on inventory click:
    if name of event-inventory is "Testing XD":
        if name of event-item is "Testing":
            send "IDK" to player
            cancel event
 
this should explain how to use inventory clicks for different slots
Code:
command gui:
    trigger:
        set {_gui} to a new chest inventory with 1 row named "Testing XD"
        set slot 0 of {_gui} to diamond named "Testing"
        open {_gui} to player

on inventory click:
    if name of event-inventory is "Testing XD":
        if index of event-slot is 0:
            send "IDK" to player
            cancel event
#or
on inventory click:
    if name of event-inventory is "Testing XD":
        if name of event-item is "Testing":
            send "IDK" to player
            cancel event
Oh Thx Bro! it worked, thank you very much