1 if not minetest.is_singleplayer() then
2 minetest.register_on_joinplayer(function(player)
3 local meta = player:get_meta()
4 local welcomed = (meta:get_int("welcomed") == 1)
5 local name = player:get_player_name()
7 minetest.chat_send_all("Welcome "..name.." to the server!")
8 meta:set_int("welcomed", 1)
10 minetest.chat_send_all("Welcome back "..name.."!")
15 local death_messages = {
17 " didn't see that coming!",
19 ", that looked painful!",
20 " is pushing up daisies!",
21 " is lucky there are infinite lives!",
27 "'s health bar is looking a little empty!",
28 " turned into a puzzle!",
29 " is in the Aether now!",
32 " dropped their stuff! Go get it!",
33 " is having a fire sale and everything's free!",
35 ", I didn't even know you could have negative health!",
36 " try not to keep dying!",
39 " is seeing how the ground feels!",
43 local leave_messages = {
47 "'s game probably crashed.",
55 minetest.register_on_dieplayer(function(player)
56 local name = player:get_player_name()
57 minetest.chat_send_all(name..death_messages[math.random(1,table.getn(death_messages))])
60 minetest.register_on_leaveplayer(function(player)
61 local name = player:get_player_name()
62 minetest.chat_send_all(name..leave_messages[math.random(1,table.getn(leave_messages))])