2019-03-02 20:32:50 -05:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-03-11 23:00:42 -04:00
|
|
|
local minetest
|
|
|
|
= minetest
|
2019-03-02 20:32:50 -05:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2019-03-10 15:47:22 -04:00
|
|
|
minetest.register_on_player_hpchange(function(player, hp)
|
|
|
|
local t = player:get_hp()
|
|
|
|
if hp + t <= 0 then
|
|
|
|
hp = 1 - t
|
|
|
|
player:set_attribute("dhp", "-1")
|
|
|
|
end
|
|
|
|
return hp
|
|
|
|
end, true)
|