When i try to test my tween i get the error Unable to cast to dictionary. How do i fix this? Here's the code:

local doormodel = script.Parent

local tweenservice = game:GetService("TweenService")
local doortweeninfo = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 0, false, 0)
							
local doortween = tweenservice:Create(doormodel.doorclosed, doortweeninfo, CFrame == doormodel.dooropen.CFrame)							
							
doormodel.LockPart.Touched:Connect(function(hit)
	if hit:IsA("Tool") and hit.Parent.Name == "Key" then
		doormodel.LockPart:Destroy()
		doortween:Play()
	end
end)

1 comment

0

which line?