From 9f5003db380b8a55eded034e056b158e346650c5 Mon Sep 17 00:00:00 2001 From: Jodsderechte <39654549+Jodsderechte@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:57:18 +0200 Subject: [PATCH] fix coloring only if relevant --- CustomNames_Chat.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CustomNames_Chat.lua b/CustomNames_Chat.lua index 0af1004..2c6a1dd 100644 --- a/CustomNames_Chat.lua +++ b/CustomNames_Chat.lua @@ -6,8 +6,12 @@ local function convertName(msg, name) local customName = lib.Get(name) if customName ~= name then local color = msg:match("|c(%x%x%x%x%x%x%x%x)(.-)|r") - local colorCodedName = WrapTextInColorCode(customName, color) - return "|Hplayer:"..name.."|h["..colorCodedName.."]|h" + if color then + local colorCodedName = WrapTextInColorCode(customName, color) + return "|Hplayer:"..name.."|h["..colorCodedName.."]|h" + else + return "|Hplayer:"..name.."|h["..customName.."]|h" + end end end