Jump to content

Recommended Posts

I was bored and did a little looking around and the nightlight uses this componet and function for it's sanity loss

(Atleast I think)

I'm not sure how you would apply that to a equiptable item, you might need someone who knows more. Hope this helps!

 

local function CalcSanityAura(inst, observer)
    local lightRadius = inst.components.burnable ~= nil and inst.components.burnable:GetLargestLightRadius() or 0
    return lightRadius > 0 and observer:IsNear(inst, .5 * lightRadius) and -.05 or 0
end
 
    inst:AddComponent("sanityaura")
    inst.components.sanityaura.aurafn = CalcSanityAura

This is just a guess, with my limited knowlege of lua. but 

I think the compoent it looking for a number value here (This might work but it also might crash, so keep backups of your modfiles! This should be the only line you need *I think*)

inst.components.sanityaura.aurafn =  2.0

  • Like 1

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...