Remove nil value on death message
parent
d619784b1c
commit
6ee151759b
5
init.lua
5
init.lua
|
@ -41,9 +41,10 @@ minetest.register_on_leaveplayer(function(ObjectRef, timed_out)
|
|||
end)
|
||||
minetest.register_on_dieplayer(function(ObjectRef, reason)
|
||||
local name = ObjectRef:get_player_name()
|
||||
matrix.send(http_api, name .. " has died! Reason:", reason)
|
||||
|
||||
if reason.type == "fall" then
|
||||
if reason.type == nil then
|
||||
matrix.send(http_api, name .. " died. Reason:", "unknown")
|
||||
elseif reason.type == "fall" then
|
||||
matrix.send(http_api, name .. " fell from a high place")
|
||||
elseif reason.type == "drown" then
|
||||
matrix.send(http_api, name .. " drowned")
|
||||
|
|
Loading…
Reference in New Issue