Dezzy Posted August 31, 2017 Share Posted August 31, 2017 I'm close to finishing up my character mod for DTS and the last thing I want to give my character for her final perk is that she will straight up refuse to eat stale and spoiled food. I figure the way of getting it to work would be mess with Wigfred's code (since she only eats meat) but i have little experience in coding and can't get it to work properly. Thank you in advance! Link to comment Share on other sites More sharing options...
waw Posted September 1, 2017 Share Posted September 1, 2017 AddPrefabPostInit("customchar", function(inst) if inst.components.eater then local Old_CanEat = inst.components.eater.CanEat function inst.components.eater:CanEat(food, ...) return food.components.perishable and not (food.components.perishable:IsStale() or food.components.perishable:IsSpoiled()) and Old_CanEat(self, food, ...) end end end) Link to comment 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