doraexplora Posted August 10, 2024 Share Posted August 10, 2024 Does anyone know the exact code to do this, I already have everything else setup Link to comment https://forums.kleientertainment.com/forums/topic/158968-i-made-a-food-item-but-how-do-i-make-it-perishable/ Share on other sites More sharing options...
Liquid Ocelot Posted August 11, 2024 Share Posted August 11, 2024 inst:AddComponent("perishable") -- Add perishable component to make inventory perishable inst.components.perishable:SetPerishTime(120) -- Item will perish after this time inst.components.perishable:StartPerishing() -- Make item start to perish inst.components.perishable.onperishreplacement = "spoiled_food" -- change it to spoiled_food, when perished Link to comment https://forums.kleientertainment.com/forums/topic/158968-i-made-a-food-item-but-how-do-i-make-it-perishable/#findComment-1740200 Share on other sites More sharing options...
doraexplora Posted August 11, 2024 Author Share Posted August 11, 2024 5 hours ago, Liquid Ocelot said: inst:AddComponent("perishable") -- Add perishable component to make inventory perishable inst.components.perishable:SetPerishTime(120) -- Item will perish after this time inst.components.perishable:StartPerishing() -- Make item start to perish inst.components.perishable.onperishreplacement = "spoiled_food" -- change it to spoiled_food, when perished thank you very much good sir Link to comment https://forums.kleientertainment.com/forums/topic/158968-i-made-a-food-item-but-how-do-i-make-it-perishable/#findComment-1740211 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