Saocao Posted May 28, 2018 Share Posted May 28, 2018 I have been trying my luck with creating new characters for Don't Starve Together by using Dleowolf's "Extended Sample Character" template, so far(and after a lot of effort) I managed to create a couple of characters who simply have readjusted stats, but now I've brought myself into adding an ability for my latest character(pictured below) which is recovering sanity from breaking boulders and chopping down trees. The only issue so far is I lack any form of coding skills and neither have I underwent any programming classes to be able to fully comprehend the lua code, if anything I've surprised myself that I made it this far. And so I've come humbly to this great forum to seek aid with my work. Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted May 28, 2018 Share Posted May 28, 2018 Going to eyeball it and say try this: local function workcheck(inst) if inst.AnimState:IsCurrentAnimation("chop_loop") or inst.AnimState:IsCurrentAnimation("pickaxe_loop") then inst.components.sanity:DoDelta(1) --+1 sanity end end inst:DoPeriodicTask(5, workcheck, nil, inst) --check every five seconds the last piece of code goes into the master_postinit the other outside of it. If it works or not I'm not sure but try it out. Link to comment Share on other sites More sharing options...
Saocao Posted May 28, 2018 Author Share Posted May 28, 2018 It worked as intended, my good sir, you have my eternal gratitude, again I praise this wonderful community and its devs. 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