Lives on Items

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

Le4ft

Member
Jun 26, 2023
20
0
1
19
Hello,

1694986793209.png

This is my item with lives and I'm facing a problem - When player dies with the items in his inventory, the actual lives count (green) should be 24,23,etc. But I don't know how can I do that, I've tried to do that with variables and NBT's but nothing seems to work (maybe it's my fault because I'm stupid). Does anyone have any ideas how should I do that?
 
Hello,

View attachment 7859
This is my item with lives and I'm facing a problem - When player dies with the items in his inventory, the actual lives count (green) should be 24,23,etc. But I don't know how can I do that, I've tried to do that with variables and NBT's but nothing seems to work (maybe it's my fault because I'm stupid). Does anyone have any ideas how should I do that?
Code:
on death of player:
   remove 1 from {lives::%player's uuid%} # Removes a life from a player
   player has sword named "&cTier I Sword": # Checks if player has the sword
      set line 1 of lore of event-item to "&7Lives: &a%{lives::%player's uuid%}%&7/25"
   # Sets the name of the sword using the variable in question