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

If player have less than x item

Discussion in 'Skript' started by PantherBoy, Jul 21, 2017.

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

    PantherBoy Well-Known Member

    Joined:
    Jul 20, 2017
    Messages:
    72
    Likes Received:
    0
    Skript Version: 2.1.2
    Minecraft Version: 1.8.8

    ---
    Full Code:
    variables:
    {fire.%player%} = 0
    {water.%player%} = 0
    {dirt.%player%} = 0
    {air.%player%} = 0
    on first join:
    give a blaze rod named "&5Varázspálca" to the player
    give a redstone named "&4Tűz esszencia" to the player
    give a clay named "&9Víz esszencia" to the player
    give a cocoa beans named "&8Föld esszencia" to the player
    give a nether quartz named "&7Levegő esszencia" to the player
    give a lapis lazuli named "&1Mana" to the player
    on player drop:
    cancel event
    every second:
    if player has less than 11 lapis lazuli:
    give a lapis lazuli named "&1Mana" to the player

    Bad part of the code:
    if player has less than 11 lapis lazuli:

    Console Errors:

    'less than 11 lapis lazuli' is not an item type (Wizardsk.sk, line 16: if player has less than 11 lapis lazuli:')

    I tried these too:
    if player's inventory does not contain 11 lapis lazuli:
    if amount of lapis lazuli in player's inventory is less than 11:

    Console error:
    'lapis lazuli in player' is not an item stack
    'player's inventory does not' is not an entity type
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Try this:
    Code (Skript):
    1. if player doesn't have 11 lapis lazuli
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    'if player doesn't' is not an entity type
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Then try switching it to
    Code (Skript):
    1. if player has 11 lapis lazuli
    . If it still doesn't work you may need to try "11 of lapis lazuli" or check your aliases to make sure you're using the right item name.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    'if player' is not an entity type

    i used lapis lazuli:
    "give a lapis lazuli named "&1Mana" to the player"
    and it's works
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. if amount of lapis lazuli in player's inventory is less than 11:
     
    • Agree Agree x 1
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    'lapis lazuli in player' is not an item stack
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1.  
    2. on join:
    3.     while player is online:
    4.         loop integers between 0 and 41:
    5.             if slot loop-integer of player's inventory is lapis lazuli named "&1Mana":
    6.                 set {_pocet} to item amount of slot loop-integer of player's inventory
    7.                 add {_pocet} to {_fpocet}
    8.         if {_fpocet} > 10:
    9.             stop
    10.         else:
    11.             give lapis lazuli named "&1Mana" to player
    12.         wait 1 second
    13.  
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    'player' is not an item stack (Wizardsk.sk, line 19: if slot loop-integer of player's inventory is lapis lazuli named "&1Mana":')
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Are you using any skript addons?
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    No, but if you tell me which addon can help me, i will download it.
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    i am not 100% sure but i think its from skellett
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I now have Skellett but it still don't work
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    try
    Code (Skript):
    1. if amount of lapis lazuli in player's inventory is less than 11:
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    'lapis lazuli in player' is not an item stack
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    ah so its another addon
    --- Double Post Merged, Jul 21, 2017, Original Post Date: Jul 21, 2017 ---
    i think it can be one from this list: WildSkript/TuSke/SkQuery/ or Umbaska
     
  17. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Might be skquery, now its in my plugins folder
     
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    @PantherBoy Vanilla skript
    Code (Skript):
    1. if number of all lapis lazuli in player's inventory is less than 11:
     
  19. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Try this (No addons required):

    Code (Skript):
    1. if player's inventory contains < 11 lapis:
     
  20. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    ' lazuli in player' is not an item stack
     
Thread Status:
Not open for further replies.
Loading...