From 671ffdd31780ae5a9b274581c1492212cebefc74 Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 9 Dec 2025 22:59:21 -0400 Subject: [PATCH 1/3] Update TODO.txt --- TODO.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.txt b/TODO.txt index 6c9849c..ee43b29 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,7 @@ Lines starting with "!" are high priority TODO: +!- Fix the winning player having a broken skin -- GUIs to do everything -- Improve the maps by adding structures -- Random loot spawning in chests in predefined places (inside houses) From 4dc405b125118cbfd6f6728f838932194eb708bc Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 9 Dec 2025 23:08:19 -0400 Subject: [PATCH 2/3] Update TODO.txt --- TODO.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.txt b/TODO.txt index ee43b29..cf25c0b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,7 +1,7 @@ Lines starting with "!" are high priority TODO: -!- Fix the winning player having a broken skin +!- Fix players turning into GreenBlob for some reason -- GUIs to do everything -- Improve the maps by adding structures -- Random loot spawning in chests in predefined places (inside houses) From 18d2bc0477c1ec265ff149ac3dab89314c2752fc Mon Sep 17 00:00:00 2001 From: a-bad-dev <244852891+a-bad-dev@users.noreply.github.com> Date: Tue, 9 Dec 2025 23:51:48 -0400 Subject: [PATCH 3/3] Use player metadata instead of a global for storing the player skin --- mods/main/init.lua | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/mods/main/init.lua b/mods/main/init.lua index c488af1..bce6a62 100644 --- a/mods/main/init.lua +++ b/mods/main/init.lua @@ -1,20 +1,13 @@ -local player_data = {} local alive_players = {} local function save_player_data(player) - local name = player:get_player_name() - player_data[name] = { - size = player:get_properties().visual_size, - skin = player:get_properties().textures, - } + player:get_meta():set_string("skin", core.serialize(player:get_properties().textures)) end local function load_player_data(player) - local name = player:get_player_name() player:set_properties({ visual = "mesh", - textures = player_data[name].skin, - visual_size = player_data[name].size, + textures = core.deserialize(player:get_meta():get_string("skin")) }) end @@ -55,7 +48,6 @@ function set_player_mode(player, mode) pointable = false, visual = "mesh", textures = {"blank.png"}, - visual_size = {x=0, y=0}, }) player:set_nametag_attributes({color = {a = 0}}) @@ -135,14 +127,6 @@ core.register_on_joinplayer(function(player) list[current_player;main;0,1.25;8,3;8] listring[current_player;main] ]]) - - local player_name = player:get_player_name() - - player_data[player_name] = { - size = player:get_properties().visual_size, - skin = player:get_properties().textures, - } - player:set_properties({pointable = false}) set_player_mode(player, "normal") @@ -230,11 +214,9 @@ core.register_chatcommand("reset", { player:get_inventory():set_list("main", {}) player:set_properties({ visual = "mesh", - textures = player_data[player_name].skin, - visual_size = player_data[player_name].size, + textures = core.deserialize(player:get_meta():get_string("skin")), pointable=false, }) - player_data[player_name] = {} end core.chat_send_all(core.colorize("red", "Match terminated.")) return ""