. . . Posted December 17, 2017 Share Posted December 17, 2017 (edited) Hello if someone can help me with this that'd be great ! So, basically I have a character who gives off negative Sanity to other players, via "inst.components.sanityaura.aura = -TUNING.SANITYAURA_SMALL" but I wanted other players who are playing as the same character not lose Sanity but gain Sanity instead is it possible to do that? Thanks for reading my question have a great day/night ! Edited December 17, 2017 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/85512-solved-is-it-possible-to-make-a-sanity-aura-from-certain-prefab-not-effect-others-of-the-same-prefab/ Share on other sites More sharing options...
pedregales Posted December 17, 2017 Share Posted December 17, 2017 Maybe this can work: Quote if inst:HasTag("player") and not inst:HasTag("your character tag") then ---inst.components.sanityaura.aura = -TUNING.SANITYAURA_SMALL elseif inst:HasTag("your character tag") then ---inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL end Link to comment https://forums.kleientertainment.com/forums/topic/85512-solved-is-it-possible-to-make-a-sanity-aura-from-certain-prefab-not-effect-others-of-the-same-prefab/#findComment-984769 Share on other sites More sharing options...
K1NGT1GER609 Posted December 17, 2017 Share Posted December 17, 2017 (edited) @pedregales You were on the right track but heres the code: local function CalcSanityAura(inst, observer) if not observer:HasTag("your character tag") then return -TUNING.SANITYAURA_SMALL elseif observer:HasTag("your character tag") then return TUNING.SANITYAURA_SMALL end --return -TUNING.SANITYAURA_LARGE end local common_postinit = function(inst) --its the function that has the minimapentity:seticon inst:AddTag("your character tag") local master_postinit = function(inst) --your main for you character, this is just reference inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = CalcSanityAura Last note I don't know if you want to put a else as a fail safe to prevent crashing but uh go ahead and do some tests. Edited December 17, 2017 by K1NGT1GER609 Link to comment https://forums.kleientertainment.com/forums/topic/85512-solved-is-it-possible-to-make-a-sanity-aura-from-certain-prefab-not-effect-others-of-the-same-prefab/#findComment-984805 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