Jump to content

Death on full wetness


Recommended Posts

local function onmoisture(inst, data)
	if data.new == inst.components.moisture:GetMaxMoisture() or inst.components.moisture:GetPercent() == 1 then
		if inst.components.health and not inst:HasTag("playerghost") then
			inst.components.health:Kill()
		end
	end
end

inst:ListenForEvent("moisturedelta", onmoisture)

 

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