josra102 Posted March 9, 2025 Share Posted March 9, 2025 The idea is that by clicking on one item on the cookpot, the cooking of a certain dish is started. Here is the component code that I used, but so far it only cooks, mumbles, or crashes: local quick_snacks_item = Class(function(self, inst) self.inst = inst self.repair_value = 1 end) function quick_snacks_item:cook(target, doer) -- target.components.container:GiveItem("tallbirdegg", 0) target.components.stewer:StartCooking(doer) if self.inst.components.stackable ~= nil then self.inst.components.stackable:Get(1):Remove() else self.inst:Remove() end end return quick_snacks_item First I wanted the bacon and eggs to cook. Help if you can. Please. Link to comment https://forums.kleientertainment.com/forums/topic/164761-need-help-with-cookpot-and-component/ Share on other sites More sharing options...
josra102 Posted March 10, 2025 Author Share Posted March 10, 2025 Okay, I solved the problem. local quick_snacks_item = Class(function(self, inst) self.inst = inst self.repair_value = 1 end) function quick_snacks_item:cook(target, doer) target.components.stewer:StartCooking(target) target.components.stewer.product = "baconeggs" if self.inst.components.stackable ~= nil then self.inst.components.stackable:Get(1):Remove() else self.inst:Remove() end end return quick_snacks_item Link to comment https://forums.kleientertainment.com/forums/topic/164761-need-help-with-cookpot-and-component/#findComment-1805978 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