need help on a /enderchest command

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

Tizo

Member
Nov 9, 2019
3
0
0
22
hello i want to do a /ec [<player>] command where when the player just types /ec his enderchest opens and he can edit everything but when he types /ec (playername) that the enderchest of the arg-1s player opens but that he cant edit anything there and just view it (im on 1.8.8)
 
hello i want to do a /ec [<player>] command where when the player just types /ec his enderchest opens and he can edit everything but when he types /ec (playername) that the enderchest of the arg-1s player opens but that he cant edit anything there and just view it (im on 1.8.8)

Do you have Essentials installed?
[doublepost=1573356881,1573356514][/doublepost]What Permissions plugin do you have installed?
 
Code:
command /enderchest [<player>]:
    aliases: ec
#    permission: server.enderchest
#    permission message: &cInsufficient permissions!
    trigger:
        if {viewmode.%player%} is true:
            send "&cPlease wait your viewmode is still enabled."
            stop
        if arg-1 is set:
            set {viewmode.%player%} to true
            open arg-1's ender chest to the player
            send "&aOpened &6%arg-1%&a's EnderChest."
            wait 10 real seconds
            send "&4Viewmode disabled."
            close player's inventory
            set {viewmode.%player%} to false
            stop
        else:
            open player's ender chest to the player
            send "&aOpened your EnderChest."
            stop
            
on inventory click:
    if {viewmode.%player%} is true:
        send "&cYou are currently in viewmode." to player
        cancel event
            
on join:
    if {viewmode.%player%} is true:
        delete {viewmode.%player%}
Give this a try? Maybe next time include which Skript version you are using, addons, etc.
 
Status
Not open for further replies.