LordTrolldork Posted June 15, 2015 Share Posted June 15, 2015 OK, so I've been working on a character, and he is all working good, but there is one problem. I want him to be able to eat rot and for the rot to be good for him, but I can't find anything to help me with this.Anyone know how to do this? My steam name is Lord_Trolldork and my email is lordtrolldork@gmail.com if you want to send me a message about this. Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/55285-how-can-i-make-rot-good-for-my-character-mod/ Share on other sites More sharing options...
Zackreaver Posted June 20, 2015 Share Posted June 20, 2015 (edited) Put this in your modmain.luaif GLOBAL.TheNet:GetIsServer() then AddPrefabPostInit("spoiled_food", function(inst) local old = inst.components.edible.oneaten inst.components.edible.oneaten = function(inst, eater) if eater.prefab == "wilson" then eater.components.health:DoDelta(4) eater.components.hunger:DoDelta(4) --note that this is in addition to whatever it has already eater.components.sanity:DoDelta(4) end if old then old(inst,eater) end end end)endwilson now gains 4 of all stats on top of the effects of eating rot. Change wilson's name to your characters prefab name and your good to go. Edit: Oh right, this isn't the DST forums, I keep forgetting that. Edited July 1, 2015 by Zackreaver Link to comment https://forums.kleientertainment.com/forums/topic/55285-how-can-i-make-rot-good-for-my-character-mod/#findComment-648559 Share on other sites More sharing options...
Mobbstar Posted June 20, 2015 Share Posted June 20, 2015 Put this in your modmain.luawilson now gains 4 of all stats on top of the effects of eating rot. Change wilson's name to your characters prefab name and your good to go. That's for Together. In DS, leave the first and last line out.AddPrefabPostInit("spoiled_food", function(inst) local old = inst.components.edible.oneaten inst.components.edible.oneaten = function(inst, eater) if eater.prefab == "wilson" then --Replace "wilson" with your character's prefab name eater.components.health:DoDelta(4) eater.components.hunger:DoDelta(4) --note that this is in addition to whatever it has already eater.components.sanity:DoDelta(4) end if old then old(inst,eater) end endend) Link to comment https://forums.kleientertainment.com/forums/topic/55285-how-can-i-make-rot-good-for-my-character-mod/#findComment-648578 Share on other sites More sharing options...
LordTrolldork Posted June 20, 2015 Author Share Posted June 20, 2015 Thanks so much, I've been trying to figure this out for a while but I couldn't find anything. So thanks It works all good Link to comment https://forums.kleientertainment.com/forums/topic/55285-how-can-i-make-rot-good-for-my-character-mod/#findComment-648752 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