Michal Ziak Posted June 13, 2019 Posted June 13, 2019 Hi guys, I am doing some questing scripts and I am stuck on one thing. inventory.getAmount sometimes returns 0 and inventory.contains("Ïtem") sometimes returns false, even if have that item in inventory, which will end with infinite shearing of sheeps, picking up buckets, etc. What are the conditions to actually show the proper amount? Do I need to have my inventory opened while doing this checks? Thank you for answer
Tom Posted June 13, 2019 Posted June 13, 2019 There shouldn't be anything wrong with the checks themselves, might be a dumb question but are you 100% spelling the item name correctly?
Neanel Posted June 13, 2019 Posted June 13, 2019 It should work fine, as Tom said above make sure you spell the item correctly (case sensitive). If it still doesn't work, post the actual code perhaps something else is wrong.
Czar Posted June 13, 2019 Posted June 13, 2019 You need to make sure the inventory is open when doing any operations, much more stable than without inventory being open, especially after log outs/breaks/mirror client in general
Michal Ziak Posted June 18, 2019 Author Posted June 18, 2019 Actually issue was, that i needed to open inventory first This topic can be closed I guess. Thank you.