Jump to content

How to lose health when sanity reaches zero?


Recommended Posts

@dave9664,

	inst:ListenForEvent("sanitydelta", function(inst, data)		if data.newpercent == 0 and not inst.crazytask then			inst.crazytask = inst:DoPeriodicTask(1, function()				if inst.components.sanity.current == 0 then					inst.components.health:DoDelta(-1, true, "craziness")				else					inst.crazytask:Cancel()					inst.crazytask = nil				end			end)		end	end)
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...