Jump to content

Recommended Posts

Hello if someone can help me with this that'd be great :D!

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 :D!

 

Edited by SuperDavid

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

 

@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 by K1NGT1GER609

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