1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

chest named?

Discussion in 'Skript' started by Dominic, Jun 3, 2018.

Thread Status:
Not open for further replies.
  1. Dominic

    Dominic Member

    Joined:
    Apr 30, 2018
    Messages:
    4
    Likes Received:
    0
    hello I need help in the code I'm working on


    Code (Skript):
    1. on death:
    2.     if {test1} is true:
    3.         if victim is a player:
    4.             set the block at location of victim to chest
    5.             set {_dchest} to the victim's location
    6.             set block west of block at location of victim to chest
    I would like that in the part of

    you can put a name to the chest for another part of my code, help pls
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    102
    Medals:
    Code (Skript):
    1. set {_dchest} to the block at victim's location
     
  3. AKE

    AKE New Member

    Joined:
    Apr 22, 2018
    Messages:
    7
    Likes Received:
    0
    open chest named "name" with 3 rows
     
  4. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    Lol, that isnt even what he's asking...
     
    • Agree Agree x 1
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,179
    Likes Received:
    218
    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
    --- Double Post Merged, Jun 13, 2018, Original Post Date: Jun 13, 2018 ---
    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 (Skript):
    1. on death:
    2.     clear drops
    3.     set {_chest} to location of player
    4.     set {_sign} to location 1 north of location of player
    5.     set block at {_chest} to chest
    6.     set block 1 west of {_chest} to chest
    7.     set block at {_sign} to wall sign
    8.     set line 2 of block at {_sign} to "&9Death Chest"
    9.     set line 3 of block at {_sign} to "%player%"
    10.     set slot 1 of block at {_chest} to player's helmet
    11.     set slot 2 of block at {_chest} to player's chestplate
    12.     set slot 3 of block at {_chest} to player's leggings
    13.     set slot 4 of block at {_chest} to player's boots
    14.     set {_num} to 0
    15.     loop 36 times:
    16.         set {_inv::%{_num}%} to slot {_num} of player's inventory
    17.         add 1 to {_num}
    18.     set {_num2} to 0
    19.     set {_num3} to 9
    20.     loop 36 times:
    21.         set slot {_num3} of block at {_chest} to {_inv::%{_num2}%}
    22.         add 1 to {_num2}
    23.         add 1 to {_num3}
    24.  
    25.  
    26. on right click on chest:
    27.     if block 1 north of event-block is a wall sign:
    28.         set {_sign} to block 1 north of event-block
    29.         if line 2 of {_sign} is "&9Death Chest":
    30.             set {_player} to line 3 of {_sign}
    31.             if {_player} is not player:
    32.                 cancel event
    33.                 send "&7[&aDeath&2Chests&7] - &cYou can not open another player's death chest"
    34.  
    35. on block break of wall sign:
    36.     if block 1 south of event-block is a chest:
    37.         if line 2 of event-block is "&9Death Chest":
    38.             if line 3 of event-block is not player:
    39.                 if player does not have permission "deathchest.admin":
    40.                     cancel event
    41.                     send "&7[&aDeath&2Chests&7] - &cYou can not break another players death chest"
    42.                 else:
    43.                     send "&7[&aDeath&2Chests&7] -&b%player% &abroke &b%line 3 of event-block%'s &adeath chest"
    44.             else:
    45.                 cancel event
    46.                 set event-block to air
    47.                 wait 1 tick
    48.                 set block 1 south of event-block to air
    49.  
    50. on block break of chest:
    51.     if block 1 north of event-block is a wall sign:
    52.         set {_sign} to block 1 north of event-block
    53.         if line 2 of {_sign} is "&9Death Chest":
    54.             if line 3 of {_sign} is not player:
    55.                 if player does not have permission "deathchest.admin":
    56.                     cancel event
    57.                     send "&7[&aDeath&2Chests&7] - &cYou can not break another players death chest"
    58.                 else:
    59.                     send "&7[&aDeath&2Chests&7] -&b%player% &abroke &b%line 3 of {_sign}%'s &adeath chest"
    60.             else:
    61.                 cancel event
    62.                 set event-block to air
    63.                 set block 1 north of event-block to air
    64.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...