Ah, I see, the problem was the "pre" in " pre joinplayer". The following code would work (I've tested it), but there is an engine bug right now, leading in a crash, I will fix it, then you can try it once updated: minetest.register_on_joinplayer(function(player) local pname = &qu...