boardman94 Posted November 12, 2014 Share Posted November 12, 2014 I have a food item that I want to make regen the players sanity over time.I have tried using sanity:DoDelta, that is only instant.I have tried making the player have a sanityaura, that doesn't work.I can do repeated DoDeltas (with a task) but then it plays the sound and flashes the indicator green.I want just the arrow. I looked at the code for the garland but could not find the sanity part. Any help would be great.Thanks Link to comment Share on other sites More sharing options...
Heavenfall Posted November 12, 2014 Share Posted November 12, 2014 Check out DoTaskInTime() Link to comment Share on other sites More sharing options...
Heavenfall Posted November 13, 2014 Share Posted November 13, 2014 So I started working on this yesterday but it turns out it's quite difficult to add things to be counted into the sanity UI badge. I couldn't come up with a good solution after an hour. Good luck. The simplest solution I could come up with was this for the prefab inst.components.edible:SetOnEatenFn(oneaten) local function oneaten(inst, eater) eater.components.sanity.dapperness = eater.components.sanity.dapperness + 1 eater:DoTaskInTime(30, function (inst) inst.components.sanity.dapperness = inst.components.sanity.dapperness - 1 end)end Link to comment Share on other sites More sharing options...
boardman94 Posted November 15, 2014 Author Share Posted November 15, 2014 @HeavenfallThanks, That produced the desired effect and will work great!Helpful, as always. 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.