Something wrong with onTouch script

The script below isn’t working. Is there a fix to it?

local man = part.Parent:FindFirstChild("Humanoid") 
script.Parent.Touched:Connect()function part()
	if man then
		workspace.door.CanCollide = false
	end
end


Use the Touched parameter the API Reference gives you, you’re trying to find the part’s Parent (Which I’m assuming could be the workspace)

script.Parent.Touched:Connect(function(Part)
    local man = Part.Parent:FindFirstChild("Humanoid")
	if man then
		workspace.door.CanCollide = false
	end
end)