Jump to content

Recommended Posts

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

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
Edited by Heavenfall

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...