Solved Item in inventory with custom name and lore

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

integro96

Member
Jan 31, 2020
2
0
1
27
Hi people! i have a issue with inventory/custom name, i want people use a "cookie" for keep inventory and xp and consume the cookie with specific name and lore oh and of course dont consume while eating. i did it in while the cookie was in hand, but i want to be in any part of the inventory.

i cant do it with the specific name and lore :emoji_frowning: i tried lot of things but i know i missing smn, can u help me?

My code:

Code:
on death:
    if player's inventory contains "&a&lGalleta de la fortuna":
        keep inventory and experiences
        clear drops
        remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
on consume:
    if player's held item with lore contains "Galleta que te permite guardar tu inventario":
        cancel event
 
Last edited:
code_language.skript:
on death:
    if player's inventory contains "&a&lGalleta de la fortuna":
        set {_slot} to 0
        loop all numbers between 0 and 36:
            set {_slOk::%{_slot}%} to slot {_slot} of player
            add 1 to {_slot}
        set {_xp} to player's xp
        
        clear drops
        remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
        set xp of player to {_xp}
        loop {_slOk::*}:
            give player loop-value
        send "&aRecibido mi inventario!"
        send "&aRecibido %{_xp}% XP de tu Galleta!"
        send "&aHo Oh! Muerte sobrevivida pero con 50%%"
on consume:
    if player's held item with lore contains "Galleta que te permite guardar tu inventario":
        cancel event
 
Hi, thx for the response but it have some errors

do i need to declare the variables or smn?

upload_2020-1-31_17-22-49.png
 
code_language.skript:
on death:
    if player's inventory contains "&a&lGalleta de la fortuna":
        set {_slot} to 0
        loop all numbers between 0 and 36:
            set {_slOk::%{_slot}%} to slot {_slot} of player
            add 1 to {_slot}
        set {_xp} to player's level
      
        clear drops
        remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
        set level of player to {_xp}
        loop {_slOk::*}:
            give player loop-value
        send "&aRecibido mi inventario!"
        send "&aRecibido %{_xp}% XP de tu Galleta!"
        send "&aHo Oh! Muerte sobrevivida pero con 50%%"
on consume:
    if player's held item is cookie named "&a&lGalleta de la fortuna" with lore "Galleta que te permite guardar tu inventario":
        cancel event
 
Status
Not open for further replies.