I'm trying to make a script where a button opens door
the code
local part = script.Parent
part.Parent = game.Workspace
local part2 = game.Workspace.Model.Part2
part2.Parent = game.Workspace.Model
local clickdetector = workspace.Model.Part.ClickDetector
local function onMouseClick()
part2.Transparency = 0.5
part2.CanCollide = false
end
clickdetector.MouseClick:connect(onMouseClick)
'Part is not valid member of Model' there is no other models in the studio and the Part in the model is named Part

2 comments
have you tried workspace.Model:WaitForChild("Part").ClickDetector?
Why are you setting part2's parent to Model when it's parent is already Model?