I’m trying to make a TweenService for a Door, but I always get an error in my Output, looks like this:
I don’t know why it isn’t working, I’m not that good at scripting so I don’t know what I did wrong.
This is my script:
local doorModel = script.Parent
local TweenService = game:GetService("TweenService")
local doorTweenInfo = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local doorTween = TweenService:Create(doorModel.Door, doorTweenInfo, {CFrame = doorModel.OpenDoor.CFrame})
doorModel.Lock.Touched:Connect(function (hit)
if hit.Parent:IsA("Tool") and hit.Parent.Name == "Key" then
doorModel.Lock:Destroy()
doorTween:Play()
end
end)