Jump to content

Recommended Posts

@--- -.-

-- replace inst with whatever the player variable is
local beard = inst.components.beard;

-- figure out last stage of beard
local max, fn = next(beard.callbacks); -- starting value
for day, cb in pairs(beard.callbacks) do 
	if day > max then
		-- found a later beard stage
		max, fn = day, cb 
	end;
end;

-- update beard day growth
beard.daysgrowth = max;

-- trigger it like OnDayComplete in the component
fn(beard.inst, beard.skinname);

 

Edited by penguin0616
  • 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...