Jump to content

Character Sanity Aura Code


Recommended Posts

-- Put the following at the bottom of your character's fn() or post-init function
inst:AddComponent("sanityaura")
inst.components.sanityaura.aura = -0.5

If you want to exclude certain receivers, you can do this:

-- Put this at the top of your character's LUA.
local function SanityAura(inst, recipient)
	-- This tells it that if the recipient is Wilson, he should get 0 sanity loss, but everyone else will get the sanity loss.
    return recipient:HasTag("wilson") and 0 or inst.components.sanityaura.aura
end

-- Put the following at the bottom of your character's fn() or post-init function
inst:AddComponent("sanityaura")
inst.components.sanityaura.aura = -0.5
inst.components.sanityaura.aurafn = SanityAura

 

Edited by Ultroman
Link to comment
Share on other sites

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
 Share

×
  • Create New...