Check your ends. Your clicked event shouldn’t have 2 ends. One of them is meant for the UnAnchor function.
Try this.
local Button = script.Parent
local Box = workspace.T1Crate.Box
local function UnAnchor()
for _, i in pairs(workspace.T1Crate:GetChildren()) do
if i:IsA(“BasePart”) then
i.Anchored = false
end
end
end
Button.MouseButton1Click:Connect(function()
Button.Text = “Box Opened”
Box:Destroy()
UnAnchor()
end)