So, I'm working on this CFrame script, where a part starts at one position and goes through an another brick, which is in a new position. Here's the script:
local cf = game.Workspace.cfrme
local db = false
function move(hit)
local human = hit.Parent:FindFirstChild(hit)
if not db then
if human then
db = true
for i = 3, 1, -0.1 do
cf.CFrame = CFrame.new(Vector3.new(-5.8,6.7,68))
cf.CFrame = CFrame.new(Vector3.new(-5.8,i,68))
end
db = false
end
end
end
cf.ClickDetector.MouseClick:Connect(move)
When I click the brick, nothing happens, and output says "Connect is not a valid member of ClickDetector". What have I done wrong here? All help is appreciated!

2 comments
Oh my gosh. I'm so stupid. I put hit in the brackets instead of humanoid. Wow. Thanks.
no problem :P it happens