Vull Posted April 22, 2017 Share Posted April 22, 2017 Recently I asked how to reduce the mind to other players. When my character "x" is next to another character "y", his sainaty is restored. How can this be done? Link to comment Share on other sites More sharing options...
Lumina Posted April 22, 2017 Share Posted April 22, 2017 Don't post your question in multiple topics pls. I didn't answered because i wasn't sure but as far as i know you just have to do : inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_HUGE Link to comment Share on other sites More sharing options...
Serpens Posted April 22, 2017 Share Posted April 22, 2017 your previous question was already answered ?! The only question left was, if it is + or - value. but why don't you just try both and see yourself wich is the right one? Link to comment Share on other sites More sharing options...
Vull Posted April 23, 2017 Author Share Posted April 23, 2017 15 hours ago, Lumina said: Don't post your question in multiple topics pls. I didn't answered because i wasn't sure but as far as i know you just have to do : inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_HUGE That's exactly what I did. But I just need to make it so that reason would be fixed with a nearby person (certain). We are doing two characters in fashion. They are connected. Link to comment Share on other sites More sharing options...
Vull Posted April 23, 2017 Author Share Posted April 23, 2017 7 hours ago, Serpens said: your previous question was already answered ?! The only question left was, if it is + or - value. but why don't you just try both and see yourself wich is the right one? I did not specify. We make a mod in which there are two characters. I do not need that he would restore from everyone. It is with another character from the mod Link to comment Share on other sites More sharing options...
Mobbstar Posted April 23, 2017 Share Posted April 23, 2017 27 minutes ago, Vull said: fixed with a nearby person A "character" or a specific "player"? inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = function(inst, other) if other.prefab == "wilson" then return TUNING.SANITYAURA_HUGE else return 0 end end Link to comment Share on other sites More sharing options...
Vull Posted April 23, 2017 Author Share Posted April 23, 2017 13 minutes ago, Mobbstar said: inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = function(inst, other) if other.prefab == "wilson" then return TUNING.SANITYAURA_HUGE else return 0 end end Let's say that the character's name is "Mario" And another "Lui" I need, when Mario is standing next to Louis, his mind is recovering. BUT. But Mario can not restore his sanity next to the Wilson or swx78 Link to comment Share on other sites More sharing options...
Mobbstar Posted April 23, 2017 Share Posted April 23, 2017 1 hour ago, Vull said: Let's say that the character's name is "Mario" And another "Lui" I need, when Mario is standing next to Louis, his mind is recovering. BUT. But Mario can not restore his sanity next to the Wilson or swx78 Give Lui the "sanityaura" component. If other.prefab == "mario" then --> Lui gives sanity only to Mario (and Mario needs to be near) --> Mario recovers sanity when next to Lui Link to comment Share on other sites More sharing options...
Vull Posted April 23, 2017 Author Share Posted April 23, 2017 16 minutes ago, Mobbstar said: Give Lui the "sanityaura" component. If other.prefab == "mario" then --> Lui gives sanity only to Mario (and Mario needs to be near) --> Mario recovers sanity when next to Lui I do not know how to do it. Thank you in advance for helping me. Link to comment Share on other sites More sharing options...
Lumina Posted April 23, 2017 Share Posted April 23, 2017 inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = function(inst, other) if other.prefab == "mario" then return TUNING.SANITYAURA_HUGE else return 0 end end This, i think. 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