Jump to content

Item repairing itself in an Icobox


Recommended Posts

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

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

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