Jump to content

Recommended Posts

I want to check if an item is in my bag (in this case Soul Chard) and let the variable "ret" be setted to "true".

This is the code I come up with:

local itemID = 6265
ret = false
for i = 0, NUM_BAG_SLOTS do
 for z = 1, GetContainerNumSlots(i) do
  if GetContainerItemID(i, z) == itemID then ret = true
  break
  end
 end
end

In the development tool it returns "true" if i got the item in back and false if I don't (like it should).

But when I insert it as a LUA-condition into the fight class it always return false and will not use my spell

How do I have to change my code?

Link to comment
https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...