1 elidragon.savedata.birthday = elidragon.savedata.birthday or {}
2 function elidragon.flower_rain(name)
3 local player = minetest.get_player_by_name(name)
7 local pos = player:get_pos()
8 minetest.add_particlespawner({
11 minpos = vector.add(pos, {x = -1, y = 2, z = -1}),
12 maxpos = vector.add(pos, {x = 1, y = 3, z = 1}),
13 minvel = {x=0, y=0, z=0},
14 maxvel = {x=0, y=0, z=0},
15 minacc = {x=0, y=-8, z=0},
16 maxacc = {x=0, y=-8, z=0},
21 collisiondetection = true,
23 texture = "flowers_rose.png",
25 minetest.after(0.5, function() elidragon.flower_rain(name) end)
27 minetest.register_on_joinplayer(function(player)
28 local name = player:get_player_name()
29 if elidragon.savedata.birthday[name] == os.date("%d/%m") then
30 minetest.chat_send_all(minetest.colorize("#FF20FF", name .. " has joined the game. Today is their birthday!"))
31 elidragon.flower_rain(name)
33 hud_elem_type = "text",
34 position = {x = 1, y = 0},
35 offset = {x = -5, y = 5},
36 text = "Happy Birthday!",
37 alignment = {x = -1, y = 1},
38 scale = {x = 100, y = 100},
43 minetest.register_chatcommand("birthday", {
44 description = "Set your birthday (e.g. 07/09 if your birthday is the seventh of september)",
46 func = function(name, param)
47 elidragon.savedata.birthday[name] = param
48 minetest.chat_send_player(name, "Birthday set to " .. param)