local max_cold = 100 --maximum amount cold protection player can store local current_cold = 100 --starting amount of cold protection player has in store local delay = 2.5 --amount of time between cold protection updates local damage = 5 --amount of damage to apply when cold protection runs out (will apply some when below 10% to start the heartbeat as a warning) local damge_delay = 2.5 --how fast damage is applied after cold protection runs out local healing = 1 --set to 0 if player doesnt automatically restore health from being inside local health_restore = 1 --how quickly health replenishes once back inside outside = 1 --set to 1 if player starts outside local max_health = nil delay = delay * 1000 damge_delay = damge_delay * 1000 function cold_level_init(e) Hide(e) CollisionOff(e) end function cold_level_main(e) Hide(e) CollisionOff(e) if max_health == nil then max_health = g_PlayerHealth else Panel(80,81,150,87) TextCenterOnX(90,84,3,"- Body Temp : "..current_cold.." / "..max_cold) if g_PlayerHealth < 1 then current_cold = max_cold end if outside == 1 then if current_cold > 0 then if GetTimer(e) > delay then StartTimer(e) if current_cold < max_cold / 10 then HurtPlayer(e,damage/10) end current_cold = current_cold - 1 end else if GetTimer(e) > damge_delay then StartTimer(e) HurtPlayer(e,damage) end end else if GetTimer(e) > delay then StartTimer(e) if current_cold < max_cold then current_cold = current_cold + 1 end if healing == 1 and g_PlayerHealth > 0 then if g_PlayerHealth < max_health then if g_PlayerHealth + health_restore <= max_health then SetPlayerHealth(g_PlayerHealth+health_restore) else SetPlayerHealth(max_health) end end end end end end end function cold_level_exit(e) end