From 9756282802b2b90800cf293928b45c9dd5a02afe Mon Sep 17 00:00:00 2001 From: Milan Date: Mon, 1 Feb 2021 19:02:04 +0100 Subject: [PATCH] illuna_aestival: add hint for death location, closes #23 --- illuna_aestival/init.lua | 1 + illuna_aestival/src/functions.lua | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 illuna_aestival/src/functions.lua diff --git a/illuna_aestival/init.lua b/illuna_aestival/init.lua index 9e6b10d..ef9ee9d 100755 --- a/illuna_aestival/init.lua +++ b/illuna_aestival/init.lua @@ -16,3 +16,4 @@ dofile(path .. "/replacer.lua") dofile(path .. "/mobs.lua") dofile(path .. "/portal.lua") dofile(path .. "/moreblocks.lua") +dofile(path .. "/functions.lua") diff --git a/illuna_aestival/src/functions.lua b/illuna_aestival/src/functions.lua new file mode 100644 index 0000000..d32548c --- /dev/null +++ b/illuna_aestival/src/functions.lua @@ -0,0 +1,7 @@ +minetest.register_on_dieplayer(function(player) + local player_name = player:get_player_name() + local pos = vector.round(player:get_pos()) + local pos_string = minetest.pos_to_string(pos) + minetest.chat_send_player(player_name, core.colorize("#F6A10A", "You have died at "..minetest.pos_to_string(pos).. ". Go and grab your stuff, before somebody else does! ;-)")) +end) +