Eumon Posted May 5, 2016 Share Posted May 5, 2016 Yo it's me again lol. Anyway back to business. My character has an aura that gives other people near her sanity. But what I want to do is make it that she needs to be at a certain sanity herself to distribute her sanity if that makes sense. Like her sanity needs to be 100+ for it to activate. Any help appreciated. Thanks in advance. Link to comment Share on other sites More sharing options...
Aquaterion Posted May 5, 2016 Share Posted May 5, 2016 it seems you already have the aura down, so I aint going to bother with looking into that; inst:ListenForEvent("sanitydelta", function()--when you sanity changes if inst.components.sanity.current >= 100 then -- aura strength = 10 else -- aura strength = 0 end end) if you cant seem to get it then post ur aura code Link to comment Share on other sites More sharing options...
CarlZalph Posted May 5, 2016 Share Posted May 5, 2016 Alternatively there's the aurafn for custom behaviour: inst.components.sanityaura.aurafn = function(inst, observer) if(inst.components.sanity.current>100) then return 10 else return 0 end end Link to comment Share on other sites More sharing options...
Eumon Posted May 6, 2016 Author Share Posted May 6, 2016 (edited) 20 hours ago, Aquaterion said: it seems you already have the aura down, so I aint going to bother with looking into that; inst:ListenForEvent("sanitydelta", function()--when you sanity changes if inst.components.sanity.current >= 100 then -- aura strength = 10 else -- aura strength = 0 end end) if you cant seem to get it then post ur aura code My code is just this. inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_TINY Probably placed somewhere wrong because it didn't work when I tested it with a friend. EDIT: NVM I got it. ^^ Edited May 6, 2016 by Eumon Solved 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