sanok15 Posted September 3, 2019 Share Posted September 3, 2019 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 More sharing options...
Ultroman Posted September 3, 2019 Share Posted September 3, 2019 if item.prefab == "armorgrass" then Link to comment Share on other sites More sharing options...
sanok15 Posted September 3, 2019 Author Share Posted September 3, 2019 30 minutes ago, Ultroman said: if item.prefab == "armorgrass" then Perfect, thank you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now