Inventory

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

Sniegras

New Member
Feb 11, 2017
6
0
0
How to open a inventory for other people, because i can't :emoji_grinning:

It opens inventory but without item, so how could i fix it?
Code:
command /OpenInv [<offline player>]:
    trigger:
        if player has permission "Staff":
            if arg-1 is set:
                loop all players in radius 10 of player:
                    open chest with 1 row named "&0Hey" to arg-1
                    wait 3 ticks
                    format slot 1 of player with coal named "Hey" to close
            else:
                send "&4Server &8> &cPlease specify player."
            
        else:
            send "&4You cant."
 
Last edited:
How to open a inventory for other people, because i can't :emoji_grinning:

Code:
command /OpenInv [<offline player>]:
    trigger:
        if player has permission "Staff":
            if arg-1 is set:
                loop all players in radius 10 of player:
                    open chest with 1 row named "&0Hey" to arg-1
                    wait 3 ticks
                    format slot 1 of player with coal named "Hey" to close
            else:
                send "&4Server &8> &cPlease specify player."
            
        else:
            send "&4You cant."
Code:
command /OpenInv [<offlineplayer>]:
    trigger:
        if player has permission "Staff":
            if arg 1 is set:
                loop all players in radius 10 of player:
                    open chest with 1 row named "&0Hey" to arg 1
                    wait 3 ticks
                    format slot 1 of arg 1 with coal named "Hey" to close
            else:
                send "&4Server &8> &cPlease specify player."
             
        else:
            send "&4You cant."
 
Code:
command /OpenInv [<offlineplayer>]:
    trigger:
        if player has permission "Staff":
            if arg 1 is set:
                loop all players in radius 10 of player:
                    open chest with 1 row named "&0Hey" to arg 1
                    wait 3 ticks
                    format slot 1 of arg 1 with coal named "Hey" to close
            else:
                send "&4Server &8> &cPlease specify player."
            
        else:
            send "&4You cant."
It's fine if you want help but spoonfeed the people doesn't help such as who ask I'll be used to be spoonfeed and not learning anything.

Now, reharding to the OP's issue, you're opening the chest to the first argument on that code but then when you put an item on the inventory with the format slot effect (which I don't recommend to use due to its bugginess (not even a real word, I know) but if you want something better you could use the TuSKe's GUI Manager) you're formatting it to the player (the command sender) and not the first argument, and that's why it's not appearing. Another thing, why are you looping the players in a radius 10 of the command sender? It just makes more lagg than it should have, unless that snippet isn't the whole script and you're using that for other stuff you should remove it.
 
Status
Not open for further replies.