I've recently tried UristMcSparks' custom chat gui tutorial, but it is not working properly. When your character dies, the Gui is reset, but I have a function that should send the messages to the player again, but it's not sending them.
Here's my code:
local messageData = {}
local MAX_MESSAGES = 10
local function storeMessage(sender, message)
for _,player in pairs(game.Players:GetPlayers()) do
-- filtrar a mensagem
local filteredMessage = sender..": "..game.Chat:FilterStringForPlayerAsync(message, player)
-- pegar a table com as mensagens antigas
local playerMessages = messageData[tostring(player.userId)]
-- adiciona uma nova mensagem à tabela
table.insert(playerMessages, filteredMessage)
-- verifica se a table está cheia. se estiver, remover a mensagem mais antiga
if #playerMessages > MAX_MESSAGES then
table.remove(playerMessages, 1)
end
-- envia a atualização pro jogador
game.ReplicatedStorage.SendMessages:FireClient(player, playerMessages)
end
end
game.Players.PlayerAdded:connect(function(player)
local playerMessages = {}
messageData[tostring(player.userId)] = playerMessages
player.Chatted:connect(function(message)
storeMessage(player.Name, message)
end)
player.CharacterAdded:connect(function(character)
game.ReplicatedStorage.SendMessages:FireClient(player, messageData[tostring(player.userId)])
end)
end)

2 comments
Tried it, my chat gui wont make to the PlayerGui, dunno why.
Did you disable the chat service roblox uses in the configure game?