there are bugs to disable drowning but without using those this is the best i could do
--time until HP change (try to keep in time with normal drowning)
local delay = 245
--how much player has when level loads
local max_health = 500
--how much to adjust HP by while drowning
local damage = 1
local init_delay = delay
local init_max_health = max_health
function breathing_underwater_init(e)
end
function breathing_underwater_main(e)
if g_PlayerPosY < 500 then
if g_PlayerHealth > 0 then
if g_PlayerHealth < max_health then
if GetTimer(e) > delay then
delay = GetTimer(e) + init_delay
SetPlayerHealth(g_PlayerHealth + (100-damage))
end
end
else
max_health = init_max_health
SetPlayerHealth(max_health)
end
else
if g_PlayerHealth < max_health then
max_health = g_PlayerHealth
end
if g_PlayerHealth > max_health then
SetPlayerHealth(max_health)
end
end
end
life's one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11