You are missing an “end)” to the ClickDetector function. Will show you below what was missing
local counter = 0
local counter2 = 0
door1 = game.Workspace.Door
local ClickDetector = script.Parent.ClickDetector
ClickDetector.MouseClick:Connect(function(PlayerWhoClicked)
while counter < 8 do
wait(0.1)
door1.Position = door1.Position + Vector3.new(0,1,0)
counter = counter + 1
end
end) – (Add this to end clickdetector)