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 Share on other sites More sharing options...
Zackreaver Posted June 20, 2015 Share Posted June 20, 2015 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. Link to comment 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 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.