The purpose of this script is to pick a random message whenever a player joins the game (There is another script in server script service that fires an event. From my testing, this seems to be working fine) , and pairs it with the username of said player, before broadcasting it in the chat. This no longer works out of the blue, due to the phasing out of the legacy chat system.
I’m pretty much a beginner when it comes to scripting, and don’t do it very often. I don’t know how I would go about fixing this. Any help/insight would be greatly appreciated if possible.
Attached is the original script.
Thank you!
local messages = {" has joined the game!", " has arrived!", " is here!", " joined the game!", " joined the server!", " has joined!"}
game.ReplicatedStorage.PlayerJoinedRE.OnClientEvent:Connect(function(plrName)
local function chat(message)
game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage("formateddeathmessage",{
Text = message;
Color = Color3.fromRGB(78, 255, 134);
Font = Enum.Font.FredokaOne;
})
end
chat(plrName .. messages[math.random(1,#messages)])
end)