ff57c0aaba
It does something similar, though it doesn't send you back to spawn, just "phase shifts" nearby.
14 lines
366 B
Lua
14 lines
366 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local minetest
|
|
= minetest
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
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)
|