Solved Set maximum item amount in inventory

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

    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.

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
How do I make it so that the maximum arrows in a person's inventory is 3, and that when It gives them an arrow, it doesnt go over the max 3 arrow limit?

Current Code:

code_language.skript:
every 3 seconds in "world":
    loop all players:
        if {Class::%loop-player%} is set:
            if player's inventory has less than 3 arrows:
                give loop-player 1 arrow
[doublepost=1502835103,1502830246][/doublepost]So yeah
 
Hm yeah i don't think this will not work. else you loop evertime player's inventory and check if player has more than 3 arrows, then SET the items to 3...
 
From memory, you can do something like this:

code_language.skript:
if amount of arrow items in loop-player's inventory is less than 3:
    add one arrow item to loop-player

I say "arrow item" instead as sometimes Skript will think of the arrow entity instead. But play around with that.
 
Status
Not open for further replies.