Jump to content

Recommended Posts

I am trying to make it so that when my character is at 0 hunger the health will deplete 2-3 times faster so that the hat my character has (the hat has a regenerating health script in it) doesn't make my character immune to hunger!

(I'd also like the hunger to deplete a teeny tiny bit quicker)

 

Here is the code I tried using but nothing happened at 0 hunger!

 

local function hungercheck(inst)
local hungercurrent = inst.components.hunger.current
if hungercurrent < 1 then
inst.components.Health:StartHurt(5,0.2)
end
end
 

thanks in advanced for any help I get! :grin:

 

EDIT: I aso tried inst.components.Health:StartRegen(-5,0.2)

 

EDIT AGAIN: fixed! code is inst.components.hunger.hurtrate = 3 (1 is default)

thanks Mr. Tiddles!

Edited by Fidooop
  • Thanks 1

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