function oxy_up_area_init(e) -- set distance to object before it triggers dist_to_obj_toff = 500 g_oxystate = 1 end function oxy_up_area_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist <= dist_to_obj_toff and g_PlayerHealth > 0 and g_oxygen_leak_on == 1 then -- GetEntityPlayerVisibility(e) -- Did player get near oxygen regen? -- -- If so set variable to 2 g_oxygen_leak_on = 2 g_oxystate = 0 end end -- function