Jump to content

Lost no sanity no matter what


Recommended Posts

So I tried making it so when my character has this specific tag that he loses no sanity whatsoever. Which means literally everything that has to do with sanity will not effect him. I asked a similar question when it came to HP healing nothing with a specific tag but i tried applying the same method with sanity with no avail. Maybe I'm just derping.

How can I make my character lose no sanity no matter what while using a tag?

Thanks!

Link to comment
Share on other sites

I think easiest way is overriding sanity component like this:

local function nolosesanity(self)
   local _DoDelta = self.DoDelta
   self.DoDelta = function(self, delta, overtime)
      if self.inst:HasTag("yourtag") then 
         return
      end		
      return _DoDelta(self, delta, overtime)
   end
end
AddComponentPostInit("sanity", nolosesanity)

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...