Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Add this function anywhere in your lapis.lua file (workshop-712396897/scripts/prefabs/lapis.lua)
- local function dotemperaturecheck(inst, dt)
- local moisterpercent = inst.components.moisture.moisture/100
- if moisterpercent > 0.01 then
- if inst.components.sanity.current > 50 then
- inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*15*moisterpercent
- elseif inst.components.sanity.current > 30 and inst.components.sanity.current <= 50 then
- inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*10*moisterpercent
- elseif inst.components.sanity.current <= 30 then
- inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*5*moisterpercent
- end
- inst.components.temperature.mintemp = 1
- inst.components.temperature.maxtemp = 69
- else
- inst.components.sanity.dapperness = 0
- inst.components.temperature.mintemp = TUNING.MIN_ENTITY_TEMP
- inst.components.temperature.maxtemp = TUNING.MAX_ENTITY_TEMP
- end
- end
- --Then, add this line to the top of the master_postinit function.
- local master_postinit = function(inst)
- inst:DoPeriodicTask(1/10, function() dotemperaturecheck(inst, 1/10) end)
- ...
- end
- --This adds a function that asks how wet you are and changes your sanity rate according to that value, and then tells the server to periodically check that function.
Add Comment
Please, Sign In to add comment