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 On death cancel drop

Discussion in 'Skript' started by PantherBoy, Aug 3, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. PantherBoy

    PantherBoy Active Member

    Joined:
    Jul 20, 2017
    Messages:
    74
    Likes Received:
    0
    How can I do this?
    Code (Skript):
    1. on death of player:
    2.     don't drop anything


     
  2. Best Answer:
    Post #13 by ShaneBee, Aug 3, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Code (Skript):
    1. on death:
    2.     clear drops
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    But I want that if a player dies, save the items in the player's inventory.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    This is a command in-game: /gamerule keepInventory true
     
    • Creative Creative x 1
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Code (Skript):
    1. on death of player:
    2.     clear drops
    3.     set {inv::%victim%::*} to items in player's inventory
    4.  
    5. on respawn: #is this an event?
    6.     add {inv::%player%::*} to player's inventory
    i think this would work not 100% sure
     
    • Creative Creative x 1
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Not all of the players.
    My full code:
    Code (Skript):
    1. on death of player:
    2.     if victim have a blaze rod named "Mentőrúd":
    3.         remove 1 blaze rod named "Mentőrúd" from the victim
    4.         don't drop anything
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    @PantherBoy
    Code (Skript):
    1. on death of player:
    2.     add drops to victim's inventory
    3.     remove drops from the drops
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Player don't get the dropped items
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    So , try in this way:
    Code (Skript):
    1. on death of player:
    2.     set {_drops::*} to drops
    3.     remove drops from the drops
    4.     add {_drops::*} to victim's inventory
     
    • Creative Creative x 1
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    same
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    I think that's the same problem of the "on drop" event.
    Can you add "broadcast %{_drops::*}%" and post here the output?
     
    • Friendly Friendly x 1
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    2 enchanted golden apples and blaze rod
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Try with a delay:
    Code (Skript):
    1. on death of player:
    2.     set {_drops::*} to drops
    3.     remove drops from the drops
    4.     wait 5 ticks
    5.     add {_drops::*} to victim's inventory
     
    • Winner Winner x 1
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Use skript-mirror for a more fluid/natural approach
     
Thread Status:
Not open for further replies.

Share This Page

Loading...