bloopers Posted January 19, 2019 Share Posted January 19, 2019 i am looking to create a character with a sanity aura around them but do not know the basic code for it. I would appreciate it if anyone can help me with this. Thank you in advance ^-^ i will attach my character.lua to the forum serena.lua Link to comment Share on other sites More sharing options...
Ultroman Posted January 19, 2019 Share Posted January 19, 2019 (edited) -- 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 January 19, 2019 by Ultroman 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