Jump to content

Recommended Posts

Posted (edited)

Guys, I'm stuck, I know it's probably a stupid question, but still: I have a loop on inventory items, but the item itself doesn't have a number, I kind of see the getCount(InventoryItem) function - but the script crashes if you use it that way. What am I missing, please tell me. p.s. I'm just new to modding, just learning how and what to do.

 

	player_inventory = self.character:getInventory()
	local player_inventory_items = player_inventory:getItems()
		for j=0, player_inventory_items:size()-1 do 
		local item = player_inventory_items:get(j)
		itemName = item:getName() - all good
		local stack_count = self.character:getInventory():getCount(item) -- ? problem 
		end;

 

Edited by Ilya_indeec
  • 1 month later...

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...