Notice: ROBLOX is updating tomorrow, which may include a crash fix. I will update this post if they do indeed fix the issue.
Hello, for the past week there has been a crash going around involving layered clothing and it has been affecting many different games such as Adopt Me. This script will fix the current crash and can be deployed in a LocalScript or a Server Script.
Explanation:
If you wonder how the crash works, the crash works from removing all Motor6Ds from your limbs (Motor6D keeps the limbs attached) and setting their velocity to high levels, which will stretch the layered clothing to be extremely large and eventually crash the client.
Script:
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
Workspace.DescendantRemoving:Connect(function(inst)
if inst:IsA("Motor6D") then
local Model = inst.Parent.Parent
if Model:IsA("Model") and Model:FindFirstChildOfClass("Humanoid") then
for i,v in pairs(Model:GetChildren()) do
if v:IsA("Accessory") and v:FindFirstChild("Handle") then
local Cheque = v.Handle:FindFirstChildOfClass("WrapLayer")
if Cheque then
v:Destroy()
--print("Destroyed possible crash attempt.")
end
end
end
end
end
end)
The script works by detecting a Motor6D disconnect, which will then check if the Motor6D was a part of a Player/NPC and delete any existing clothing to prevent a crash.
If you are a developer, it is recommended to put it in a server script, however it will work with LocalScripts also.
Enjoy