Author Topic: Item Variable Persistence?  (Read 2917 times)

Messing with serverCmdDropTool isn't the only source of problems, but also the opposite: picking up items. There doesn't appear to be a decent way of explicitly detecting which slot the item went into when picked up other than things like looking at the inventory difference before and after the parent pickup logic. That isn't even necessarily perfectly reliable. Quite a few add-ons mess with item pickup logic to do things like picking up multiple of the same item, changing items on pickup, ammo stuff, etc.

There doesn't appear to be a decent way of explicitly detecting which slot the item went into when picked up other than things like looking at the inventory difference before and after the parent pickup logic.

Oh well.
I had a try at it and that's exactly where I got stumped at, nevertheless a user-friendly support script such as this would be incredibly useful.

could manually keep a record of the players inventory when they pick up items, so that you have a reference you can compare to

could manually keep a record of the players inventory when they pick up items, so that you have a reference you can compare to

than things like looking at the inventory difference before and after the parent pickup logic. That isn't even necessarily perfectly reliable. Quite a few add-ons mess with item pickup logic to do things like changing items on pickup, ammo stuff, etc.

But I suppose yes, it's the most viable method other than completely breaking picking up items for add-ons not made for it.

how would you check before without manually logging each players items?

how would you check before without manually logging each players items?

Save their items in local variables before calling the parent implementation

That was the other way I was thinking it could be done, but then you need to worry about other addons that might change things before/after you get to it

but if that isn't an issue, then it would probably be better because then if you manually shove items into the person's inventory without calling the pickup function, then it will still work correctly