number of loop-item

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

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
47
Hey guys,
I am working on a skript that checks someones inventory of items and broadcast it.
but i got a problem:


code_language.skript:
                            else if loop-item is a sunflower:
                                if amount of loop-item is greater than 1:
                                    add "%amount of loop-item% coins" to {inv::*}

This code isnt working.
I tried this:

code_language.skript:
                            else if loop-item is a sunflower:
                                if number of loop-item in player's inventory is greater than 1:
                                    add "%number of loop-item in player's inventory%  coins" to {inv::*}

This kinda works, but if i have like 2 coins in one slot, and 4 in another, it broadcasts "6 coins, 6 coins" instead of "2 coins, 4 coins"

Can you guys help me out?
 
Hey guys,
I am working on a skript that checks someones inventory of items and broadcast it.
but i got a problem:


code_language.skript:
                            else if loop-item is a sunflower:
                                if amount of loop-item is greater than 1:
                                    add "%amount of loop-item% coins" to {inv::*}

This code isnt working.
I tried this:

code_language.skript:
                            else if loop-item is a sunflower:
                                if number of loop-item in player's inventory is greater than 1:
                                    add "%number of loop-item in player's inventory%  coins" to {inv::*}

This kinda works, but if i have like 2 coins in one slot, and 4 in another, it broadcasts "6 coins, 6 coins" instead of "2 coins, 4 coins"

Can you guys help me out?
code_language.skript:
command /test:
    trigger:
        loop all items in the player's inventory:
            loop-item is sunflower:
                set {_amount} to amount of loop-item
                send "%{_amount}%"
It will send you the amount of sunflower for each slot (If there is any sunflower of course) Like: 64,64,31,4,5
 
Status
Not open for further replies.