Jump to content

How to ask for an specific item


Recommended Posts

Hello, I want to know how to compare the item name of an equiped item with a string in the code. Here my try:

local oldEquip = inst.components.inventory.Equip
	inst.components.inventory.Equip = function(self, item, old_to_active)
	if item == "armorgrass" then
	print("armorgrass equipped ")
	end
	oldEquip(self, item, old_to_active)
end

I searched in logs für "armorgrass equipped" but I couldn't find so it doesn't work I guess...
Maybe you could help me :) 

Link to comment
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
 Share

×
  • Create New...