#how to fix this bug

1 messages · Page 1 of 1 (latest)

limber knoll
#

I was testing this skript out with others and instead of just keep inventory for the wools it dupe what the player already had

    remove {Wools::*} from the drops
    loop {Wools::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::%victim's uuid%::*}
on respawn:
    wait 1 tick
    give {idk::%player's uuid%::*} to player
    remove {idk::%player's uuid%::*}```
inner rock
#

what does this have to do with skbee or skript reflect

#

also, for the 100th time, just because something works one way doesn't mean that way is a good way to do it

#

you have a very nice and easy to use list set up, you should use it whenever you need to instead of using redundant global variables

limber knoll
#

what no this is as confusing as hell

#

none of this skript makes sense

#

if you could explain every line that would be nice ; )

inner rock
#

we explained it to you as you were making it, you just forgot.
that's why I recommend you mark stuff with comments, and adding spaces so things are easier to look through

#
    # Remove the entire list of all custom wool items from the loot
    remove {Wools::*} from the drops

    # Loop (go through) each custom wool item in the list
    loop {Wools::*}:
        # if the player that died has the wool (for this loop) in their inventory
        if victim's inventory contains loop-value:
            # add the wool item to a list to give it back whn they respawn
            add 1 of loop-value to {idk::%victim's uuid%::*}

on respawn:
    wait 1 tick

    # give the list of wools they had on death
    give {idk::%player's uuid%::*} to player
    # clear the list to save storage space
    remove {idk::%player's uuid%::*}```
#

As for it "duplicating wools", do you have keep inventory on..?

limber knoll
#

no

#

wait how do you clear the list

#

cuz remove {idk::%player's uuid%::*} this part does not work

inner rock
#

delete or clear is the correct syntax

limber knoll
#

oh

inner rock
#

and even though you only use this list for a while, don't name it idk, as you have a history of giving sloppy names, if you use idk again it will screw things up. name it something like keepWools

limber knoll
#

oh

inner rock
limber knoll
#

oh

#

they do lose stuff tho

inner rock
#

or maybe check and see if you maybe have 2 on death events, maybe you are doubling the list.

#

because iirc there were some issues with you getting this off the parser into your server