From e596a063a82fe57393c9e97034106e702b1b25b2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 31 Aug 2019 00:58:56 +0200 Subject: [PATCH] Select random player skin for new players --- mods/player_skins/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/player_skins/init.lua b/mods/player_skins/init.lua index e4b454f..069d155 100644 --- a/mods/player_skins/init.lua +++ b/mods/player_skins/init.lua @@ -97,8 +97,10 @@ end local function on_joinplayer(player) local name = player:get_player_name() + -- New players start with a random skin if player_skins.skins[name] == nil then - player_skins.skins[name] = "male" + local skin = math.random(1, #player_skins.skin_names) + player_skins.skins[name] = player_skins.skin_names[skin] end end