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.

Solved keepInventory

Discussion in 'Skript' started by Sander Vereecke, Mar 30, 2020.

Thread Status:
Not open for further replies.
  1. Sander Vereecke

    Joined:
    Dec 19, 2019
    Messages:
    31
    Likes Received:
    2
    I wanna make a code that let you drop you items on death when you got killed by a player and when not it wouldn't drop your items. I have tried this but it doesn't work. Can anyone help me?

    Code (Text):
    1. on death:
    2.     if attacker is a player:
    3.         if victim is a player:
    4.             execute console command "/gamerule keepInventory false"
    5.             wait 1 tick
    6.             execute console command "/gamerule keepInventory true"
     
  2. Best Answer:
    Post #2 by Abdera7mane, Mar 30, 2020
  3. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    Simply do
    Code (Text):
    1. on death of a player:
    2.     if attacker is a player:
    3.         keep inventory
     
Thread Status:
Not open for further replies.

Share This Page

Loading...