Loading init.lua +19 −5 Original line number Diff line number Diff line Loading @@ -58,20 +58,34 @@ core.register_on_dieplayer(function(player) -- Death by lava if node.groups.lava ~= nil then core.chat_send_all(string.format(messages.lava[math.random(1,#messages.lava)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by drowning elseif player:get_breath() == 0 then core.chat_send_all(string.format(messages.water[math.random(1,#messages.water)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by fire elseif node.name == 'fire:basic_flame' then core.chat_send_all(string.format(messages.fire[math.random(1,#messages.fire)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by something else else core.chat_send_all(string.format(messages.other[math.random(1,#messages.other)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end end end) minetest.register_on_respawnplayer( function(player) local player_name = player:get_player_name() core.chat_send_all(string.format(messages.respawn[math.random(1,#messages.respawn)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s returns.', player:get_player_name())) end end) Loading
init.lua +19 −5 Original line number Diff line number Diff line Loading @@ -58,20 +58,34 @@ core.register_on_dieplayer(function(player) -- Death by lava if node.groups.lava ~= nil then core.chat_send_all(string.format(messages.lava[math.random(1,#messages.lava)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by drowning elseif player:get_breath() == 0 then core.chat_send_all(string.format(messages.water[math.random(1,#messages.water)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by fire elseif node.name == 'fire:basic_flame' then core.chat_send_all(string.format(messages.fire[math.random(1,#messages.fire)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end -- Death by something else else core.chat_send_all(string.format(messages.other[math.random(1,#messages.other)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s died.', player:get_player_name())) end end end) minetest.register_on_respawnplayer( function(player) local player_name = player:get_player_name() core.chat_send_all(string.format(messages.respawn[math.random(1,#messages.respawn)], player:get_player_name())) if minetest.get_modpath("irc") then irc:say(string.format('*** %s returns.', player:get_player_name())) end end)