Thebrettstoner Posted December 7, 2018 Share Posted December 7, 2018 Hello! I am currently trying to make an item that repairs itself when its in an icebox, but i'm getting a bit stuck. i can't make the item detect when its in an icebox, i can make it do a function once its in any inventory but i cant seem to specify "icebox". Im surrently using: inst.components.inventoryitem:GetContainer() to try and dectect it. any help would be very appreciated! Link to comment Share on other sites More sharing options...
Wolf_EX Posted December 7, 2018 Share Posted December 7, 2018 if inst.components.inventoryitem:GetContainer().inst.prefab == "icebox" Link to comment Share on other sites More sharing options...
Ultroman Posted December 7, 2018 Share Posted December 7, 2018 And if you want it to work in any fridge-like prefab, like the Ice Backpack etc., you can do: if inst.components.inventoryitem:GetContainer().inst:HasTag("fridge") then -- do something end Link to comment Share on other sites More sharing options...
Thebrettstoner Posted December 8, 2018 Author Share Posted December 8, 2018 10 hours ago, Wolf_EX said: if inst.components.inventoryitem:GetContainer().inst.prefab == "icebox" 9 hours ago, Ultroman said: And if you want it to work in any fridge-like prefab, like the Ice Backpack etc., you can do: if inst.components.inventoryitem:GetContainer().inst:HasTag("fridge") then -- do something end Thank both of you so much! Works like a charm now! 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