chest named?

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

Dominic

Member
Apr 30, 2018
4
0
0
22
Ecuador
twitter.com
hello I need help in the code I'm working on


code_language.skript:
on death:
    if {test1} is true:
        if victim is a player:
            set the block at location of victim to chest
            set {_dchest} to the victim's location
            set block west of block at location of victim to chest
I would like that in the part of

set {_dchest} to the victim's location

you can put a name to the chest for another part of my code, help pls
 
code_language.skript:
set {_dchest} to the block at victim's location
 
Lol, that isnt even what he's asking...
haha i was thinking the exact same thing

i have tried numerous ways to make this work, still working on it.

Personally i do not see the point of having a named chest, as the only time you will see it is when you open the chest.

What I would do, is add a sign to the front of the chest with the player's name on it, OR a hologram above with their name
[doublepost=1528925082,1528922296][/doublepost]like this for example
(Not the best written thing)
just quickly wrote this up to give you an example of what I would do
code_language.skript:
on death:
    clear drops
    set {_chest} to location of player
    set {_sign} to location 1 north of location of player
    set block at {_chest} to chest
    set block 1 west of {_chest} to chest
    set block at {_sign} to wall sign
    set line 2 of block at {_sign} to "&9Death Chest"
    set line 3 of block at {_sign} to "%player%"
    set slot 1 of block at {_chest} to player's helmet
    set slot 2 of block at {_chest} to player's chestplate
    set slot 3 of block at {_chest} to player's leggings
    set slot 4 of block at {_chest} to player's boots
    set {_num} to 0
    loop 36 times:
        set {_inv::%{_num}%} to slot {_num} of player's inventory
        add 1 to {_num}
    set {_num2} to 0
    set {_num3} to 9
    loop 36 times:
        set slot {_num3} of block at {_chest} to {_inv::%{_num2}%}
        add 1 to {_num2}
        add 1 to {_num3}


on right click on chest:
    if block 1 north of event-block is a wall sign:
        set {_sign} to block 1 north of event-block
        if line 2 of {_sign} is "&9Death Chest":
            set {_player} to line 3 of {_sign}
            if {_player} is not player:
                cancel event
                send "&7[&aDeath&2Chests&7] - &cYou can not open another player's death chest"

on block break of wall sign:
    if block 1 south of event-block is a chest:
        if line 2 of event-block is "&9Death Chest":
            if line 3 of event-block is not player:
                if player does not have permission "deathchest.admin":
                    cancel event
                    send "&7[&aDeath&2Chests&7] - &cYou can not break another players death chest"
                else:
                    send "&7[&aDeath&2Chests&7] -&b%player% &abroke &b%line 3 of event-block%'s &adeath chest"
            else:
                cancel event
                set event-block to air
                wait 1 tick
                set block 1 south of event-block to air

on block break of chest:
    if block 1 north of event-block is a wall sign:
        set {_sign} to block 1 north of event-block
        if line 2 of {_sign} is "&9Death Chest":
            if line 3 of {_sign} is not player:
                if player does not have permission "deathchest.admin":
                    cancel event
                    send "&7[&aDeath&2Chests&7] - &cYou can not break another players death chest"
                else:
                    send "&7[&aDeath&2Chests&7] -&b%player% &abroke &b%line 3 of {_sign}%'s &adeath chest"
            else:
                cancel event
                set event-block to air
                set block 1 north of event-block to air
 
Status
Not open for further replies.