I tried to make a code for a chair that disappears once you click it and you can't touch it. I played my game but then only the seat disappeared when I clicked it. Here is my code:
local Part = script.Parent:GetChildren("Part")
local Seat = script.Parent:FindFirstChild("Seat")
function onClick()
Part.Transparency = 1
Part.CanCollide = false
Seat.Transparency = 1
Seat.CanCollide = false
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
I put it into the output and it said that there were no errors. Help??
P.S. I should mention that there are many parts, not just one.

1 comment
On line 10 use :Connect(), :connect() is deprecated.