Jump to content

how to make refrigerator character?


Recommended Posts

In that case, this should do it

inst.ListenForEvent("itemget", function(inst, data)
	local item = data.item
	if item.components.edible and item.components.perishable and item.components.perishable.updatetask ~= nil then
		item.components.perishable:StopPerishing()
		item.wasperishing = true
	end
end)

inst.ListenForEvent("dropitem", function(inst, data)
	local item = data.item
	if item.wasperishing and item.components.edible and item.components.perishable and item.components.perishable.updatetask == nil then
		item.components.perishable:StartPerishing()
	end
end)

 

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