✓ Accepted answer
A for loop gets the amount of something within a table, for the function, you are not getting a table of any sort, just the Part/Model/Ect., also, the remove method, as stated on the ROBLOX WIKI, the remove method only reverts a Child's Parent to nil, I would use the Destroy method instead, last but not least, you are not checking if the specifier door and guy are exactly existant, please use the WaitForChild method or FindFirstChild method to check if existant. Here is how your script would look like;
local door=game.Workspace:WaitForChild("trigger1"):FindFirstChild("buttonpart")
local guy=game.Workspace:WaitForChild("hangingchain"):FindFirstChild("guy")
function onTouch()
if not door or not guy then return end
door:Destroy()
for i,v in pairs(guy:GetChildren()) do
if v and v:IsA("BasePart") then
v:Destroy()
end
end
end
script.Parent.Touched:connect(onTouch)
Hope this helped!