mtimer/system/on_joinplayer.lua

11 lines
325 B
Lua
Raw Normal View History

2019-02-16 16:45:32 +01:00
local m = mtimer
minetest.register_on_joinplayer(function(player)
local meta = player:get_meta()
for _,def in pairs(m.meta) do
local current = meta:get_string(def.key)
if current == '' then meta:set_string(def.key, def.default) end
end
meta:set_string('mtimer:session_start', os.time())
2019-02-16 16:45:32 +01:00
end)