Trying to make an open and close door but it gives me an error saying "Unable to cast to dictionary"
local door = game.Workspace.Door
local TweenService = game:GetService("TweenService")
local TweenStyle = TweenInfo.new(0.5,Enum.EasingStyle.Quad)
local dooropen = (door.CFrame + Vector3.new(0, 10, 0))
local doorclose = (door.CFrame + Vector3.new(0, -10, 0))
local doortween = TweenService:Create(door,TweenStyle,doorclose)
local closedoortween = TweenService:Create(door,TweenService,dooropen)
script.Parent.ClickDetector.MouseClick:Connect(function()
doortween:Play()
wait(5)
closedoortween:Play()
end)
Does anyone know how to fix it? Edit: The error is on line 9

6 comments
Two things, OP made a mistake on line 10 (he put TweenService as the second argument)
For line 6 & 7, OP wanted the CFrame to be "door.CFrame + CFrame.new", not "door.CFrame * CFrame.new"
sorry I was on mobile XD
Btw there is no CFrame + CFrame metamethod field in the CFrame metatable class.
This does work, but it doesn't slide the door up it slides it down then up and it doesn't even close properly
So change it from Y to X... I didn't know your original idea XD