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 Item in inventory with custom name and lore

Discussion in 'Skript' started by integro96, Jan 31, 2020.

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

    integro96 Member

    Joined:
    Jan 31, 2020
    Messages:
    2
    Likes Received:
    0
    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 (Text):
    1. on death:
    2.     if player's inventory contains "&a&lGalleta de la fortuna":
    3.         keep inventory and experiences
    4.         clear drops
    5.         remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
    6. on consume:
    7.     if player's held item with lore contains "Galleta que te permite guardar tu inventario":
    8.         cancel event


     
    #1 integro96, Jan 31, 2020
    Last edited: Feb 3, 2020
  2. Best Answer:
    Post #4 by novastosha, Feb 1, 2020
  3. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    Code (Skript):
    1. on death:
    2.     if player's inventory contains "&a&lGalleta de la fortuna":
    3.         set {_slot} to 0
    4.         loop all numbers between 0 and 36:
    5.             set {_slOk::%{_slot}%} to slot {_slot} of player
    6.             add 1 to {_slot}
    7.         set {_xp} to player's xp
    8.        
    9.         clear drops
    10.         remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
    11.         set xp of player to {_xp}
    12.         loop {_slOk::*}:
    13.             give player loop-value
    14.         send "&aRecibido mi inventario!"
    15.         send "&aRecibido %{_xp}% XP de tu Galleta!"
    16.         send "&aHo Oh! Muerte sobrevivida pero con 50%%"
    17. on consume:
    18.     if player's held item with lore contains "Galleta que te permite guardar tu inventario":
    19.         cancel event
     
  4. integro96

    integro96 Member

    Joined:
    Jan 31, 2020
    Messages:
    2
    Likes Received:
    0
    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
     
  5. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    Code (Skript):
    1. on death:
    2.     if player's inventory contains "&a&lGalleta de la fortuna":
    3.         set {_slot} to 0
    4.         loop all numbers between 0 and 36:
    5.             set {_slOk::%{_slot}%} to slot {_slot} of player
    6.             add 1 to {_slot}
    7.         set {_xp} to player's level
    8.      
    9.         clear drops
    10.         remove 1 cookie named "&a&lGalleta de la fortuna" from player's inventory
    11.         set level of player to {_xp}
    12.         loop {_slOk::*}:
    13.             give player loop-value
    14.         send "&aRecibido mi inventario!"
    15.         send "&aRecibido %{_xp}% XP de tu Galleta!"
    16.         send "&aHo Oh! Muerte sobrevivida pero con 50%%"
    17. on consume:
    18.     if player's held item is cookie named "&a&lGalleta de la fortuna" with lore "Galleta que te permite guardar tu inventario":
    19.         cancel event
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...