Loop all items in... error.

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

Lummox

Member
Jan 29, 2017
28
0
1
42
I have these two errors with "loop all items in ..."

I'm using lastest version of benkus skript and addons.

Error 1:

There's no loop that matches 'loop-player's inventory' (caducidad.sk, line 92: loop all items in loop player's inventory:')

code_language.skript:
at 00:00 in world "world":
    loop players:
        [B][I][COLOR=#59b300]loop all items in loop-player's inventory:[/COLOR][/I][/B]
            loop-item is {@carne_fresca}          
            set {_fecha::*} to uncolored lore of loop-item split at "/"
            replace "Fecha: " with "" in  {_fecha::1}
            set {_fecha::1} to {_fecha::1} parsed as integer
            if {_fecha::1}-{calendario.dia} is greater than 3:
                set {_cantidad} to amount of loop-item in loop-player's inventory
                remove {_cantidad} of loop-item from loop-player's inventory
                give {_cantidad} of rotten_flesh named "Carne de vaca podrida" to loop-player
                send "{@prefijos-caducidad-valor} <light red>Hay carne de tu inventario que ha caducado" to loop-player
                stop
            if {calendario.dia}-{_fecha::1} is greater than 3:
                send "La diferencia de dias es mas de 3" to loop-player
                set {_cantidad} to amount of loop-item in loop-player's inventory
                remove {_cantidad} of loop-item from loop-player's inventory
                give {_cantidad} of rotten_flesh named "Carne de vaca podrida" to loop-player
                send "{@prefijos-caducidad-valor} <light red>Hay carne de tu inventario que ha caducado" to loop-player
                stop

Error 2:

the clicked block is not a world (caducidad.sk, line 52: loop all items in inventory of clicked block:')

code_language.skript:
on right click:
    target block is a chest
    [COLOR=#59b300][B]loop all items in inventory of clicked block:[/B][/COLOR]
        loop-item is {@carne_fresca}
        set {_fecha::*} to uncolored lore of loop-item split at "/"
        replace "Fecha: " with "" in  {_fecha::1}
        set {_fecha::1} to {_fecha::1} parsed as integer
        if {_fecha::1}-{calendario.dia} is greater than 3:
            set {_drop} to amount of loop-item in inventory of clicked block
            remove {_drop} of loop-item from inventory of clicked block
            give {_drop} of rotten_flesh named "Carne de vaca podrida" to inventory of clicked block
            message "{@prefijos-caducidad-valor} <light red>Hay carne en el que ha caducado"
            stop
        if {calendario.dia}-{_fecha::1} is greater than 3:
            set {_drop} to amount of loop-item in inventory of clicked block
            remove {_drop} of loop-item from inventory of clicked block
            give {_drop} of rotten_flesh named "Carne de vaca podrida" to inventory of clicked block
            message "{@prefijos-caducidad-valor} <light red>Hay carne en el que ha caducado"
            stop
 
try using this instead? It loads for me successfully. not able to sign in and test though.
code_language.skript:
"%loop-item%" = "{@carne_fresca}"
 
It gives me the same error.

The errors are in these two lines:

loop all items in loop-player's inventory:

and

loop all items in inventory of clicked block:
 
I'm not 100% sure but I think this works

loop loop-player's inventory

loop clicked block's inventory

2854dd2035eb9382a20e81a3f2fe7d3f.png
 
Status
Not open for further replies.