From cced744c84650e21207ac3ecd74d8eabcbcd3dd5 Mon Sep 17 00:00:00 2001 From: Tai Kedzierski Date: Thu, 17 Jan 2019 15:24:08 +0000 Subject: [PATCH] make readonly and do not display if player is dead --- announcement/init.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/announcement/init.lua b/announcement/init.lua index 0a4066f..41c8dce 100644 --- a/announcement/init.lua +++ b/announcement/init.lua @@ -24,7 +24,7 @@ local reload = function() formspeccer:add_textarea(fsn,{ xy="1,1", wh="19,8", - name="announce", + name="", -- empty, to make it readonly label="Welcome!", value=an_data, }) @@ -52,9 +52,10 @@ minetest.register_chatcommand("announcement",{ }) minetest.register_on_joinplayer(function(player) - if mdisplay then - minetest.after(0.5,function(...) - formspeccer:show(player,fsn ) - end) + if mdisplay and player:get_hp() > 0 then + -- Displaying when dead causes respawn dialog to disappear. + minetest.after(0.5,function(...) + formspeccer:show(player,fsn ) + end) end end)