Make unstackable items stackable

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

ZeyKra_

Active Member
Dec 12, 2019
109
2
18
18
a baguette
Hello, I would like to stack golden axe on pickup but I don't know how.

I there a way to stack golden axe on pickup like :

Code:
On pickup:
   wait a tick
   stack all golden axe from player inventory
 
Hello, I would like to stack golden axe on pickup but I don't know how.

I there a way to stack golden axe on pickup like :

Code:
On pickup:
   wait a tick
   stack all golden axe from player inventory

This is no ryl possible. the only way u can do this is coding every exception to make it stable so with inventory clicks and setting item amounts removing old items etc
 
Here, I made both a skript-mirror effect and a function for it! Have fun c:
(Untested)
Code:
effect stack [all] %itemstack% in %player%'[s] inventory:
    trigger:
        loop all items in expr-2's inventory:
            if loop-item is expr-1:
                add 1 to {_items}
                set loop-item to air
                if expr-2's inventory doesn't contain expr-1:
                    stop loop
        loop all items in expr-2's inventory:
            if loop-item is air:
                set {_item} to expr-1 * {_items}
                set loop-item to {_item}
                stop loop

function stackItem(i: item, p: player):
    loop all items in {_p}'s inventory:
        if loop-item is {_i}:
            add 1 to {_items}
            set loop-item to air
            if {_p}'s inventory doesn't contain {_i}:
                stop loop
    loop all items in {_p}'s inventory:
        if loop-item is air:
            set {_item} to {_i} * {_items}
            set loop-item to {_item}
            stop loop
 
Status
Not open for further replies.