I already tried to add something like this in my class code and it does not work. Help me plz.
Code: Select all
function CheckRunScroll()
stateID = {9960};
foodName = {"Greater Running Scroll"};
flag = 0;
for _,v in ipairs(stateID) do
if Player:GetState():GetState( v ) ~= nil then
flag = flag + 1;
end
end
if flag == 0 then
for a,b in ipairs(foodName) do
if Helper:CheckAvailableInventory( b ) then
PlayerInput:Inventory( b );
break;
end
end
end
return true;