Whenever I try to make a tween door it gives the the error workspace .doorModel .script :10: attempted to call nil value I can't find a way to fix it. Here's the script.
local doormodel = script.Parent
local tweenservice = game:GetService("TweenService")
local doortweeninfo = TweenInfo.create(
1,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out,
0,
false,
0
)
local doortween = tweenservice:Create(doormodel.doorclosed, doortweeninfo, (CFrame.new == 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)

3 comments
which line is it? the error
oops nervermind
when i click the error it takes me to line 10