You have a few flaws in your last code posted, at least in these two lines, that I can spot:
local SlideInTween = TweenService:Create(SlidingDoor, Tweeninfo,SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0, 5.3))
local SlideOutTween = TweenService:Create(SlideInTween,Tweeninfo,SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0,-5.3))
The flaws are in the details. And these are very specific details, that you should learn about.
Do please understand, that the TweenService:Create()
method needs three arguments of the following types:
- An instance that will be affected (usually not a
Model
, but aBasePart
/Part
) - A
TweenInfo
object - A “dictionary” (table) containing the property-names to affect, and what value to reach (goal).
1.
So your statement here is wrong, as the third argument is clearly not a “dictionary”, but only a CFrame
:
TweenService:Create(SlidingDoor, Tweeninfo, SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0,5.3))
To “fix it”, you need to write the code as such (oh, I also changed the first argument):
TweenService:Create( SlidingPanel, Tweeninfo, { CFrame = SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0,5.3) } )
2.
Your second statement creating a tween, has even one more problem, this time with its first argument. Why do you suddenly want to tween the SlideInTween
-object?
local SlideOutTween = TweenService:Create(SlideInTween, Tweeninfo, SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0,-5.3))
I guess it could have been a typing mistake, but the computer does not know that. So the statement should look like this:
local SlideOutTween = TweenService:Create( SlidingPanel, Tweeninfo, { CFrame = SlidingPanel.Cframe * CFrame.new(SlidingPanel.Size.X + 0,0,-5.3) } )
3.
These details were also there in colbert2677’s tutorial if you look very closely at his code samples.