death_formspec.lua 534 B

12345678910111213141516
  1. -- CSM death formspec. Only used when clientside modding is enabled, otherwise
  2. -- handled by the engine.
  3. core.register_on_death(function()
  4. core.display_chat_message("You died.")
  5. local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
  6. "label[4.85,1.35;" .. fgettext("You died") ..
  7. "]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
  8. core.show_formspec("bultin:death", formspec)
  9. end)
  10. core.register_on_formspec_input(function(formname, fields)
  11. if formname == "bultin:death" then
  12. core.send_respawn()
  13. end
  14. end)