I’ve found a snippet of code that lags the game indefinitely. How can I patch this?
local malformed = string.rep("ก็็็▌▓", math.random(10000, 2e5))
local remote = game:GetService'ReplicatedStorage'.DefaultChatSystemChatEvents:WaitForChild'SayMessageRequest'
while wait() do
remote:FireServer(malformed, malformed)
end
If you really want to go all in you could possibly fork the core chat module and edit it to prevent spam messages from being displayed to the other players entirely.
If that’s a malformed string as you say it is, that would cause the utf8 library to error. This is sort of a janky solution, but you could do something like
pcall(function()
for _, _ in pairs(utf8.graphemes(string) do end
end)