Artemmm91 Posted February 13, 2018 Share Posted February 13, 2018 (edited) I want to do like this: after eating my custom food(for example "cake") i want to get in the inventory some items(for example cutgrass). I tryed to add component lootable, workable, but still dont know how to make this. Any ideas? Edited February 13, 2018 by Artemmm91 Link to comment https://forums.kleientertainment.com/forums/topic/87569-how-write-that-after-eating-you-getting-something/ Share on other sites More sharing options...
Aquaterion Posted February 13, 2018 Share Posted February 13, 2018 inst.components.edible:SetOnEatenFn(function(inst, eater) if eater and eater.components.inventory then eater.components.inventory:GiveItem(SpawnPrefab("cutgrass")) end end) this would go in your customprefab.lua If you wanted this to work only for a specific character then it would require to be a little different Link to comment https://forums.kleientertainment.com/forums/topic/87569-how-write-that-after-eating-you-getting-something/#findComment-1003804 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