Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I got an error 'Temp read failed' and I don't know how to fix it after researching. Help?

Asked by 2 years ago

This simple equip script is giving off the error "Temp read failed" and I've never encountered this error before and I need help Script (line 9, at local itemp):

for i,v in pairs(player.Items:GetChildren()) do
        if not v.Equipped.Value then
            if player.Character:FindFirstChild(v.Name) then
                player.Character:FindFirstChild(v.Name):Destroy()
            end

        else
            if not player.Character:FindFirstChild(v.Name) then
                local itemp = game:GetService("InsertService"):LoadAsset(v.Id.Value):GetChildren()[1]
                itemp.Parent = player.Character
                itemp.Name = v.Name

                for i,v in pairs(itemp:GetDescendants()) do
                    if v.ClassName == "LocalScript" or v.ClassName == "Script" or v.ClassName == "Sound" then
                        v:Destroy()
                    end
                end
            end
        end
    end
end

Answer this question