Animated door not working

Hello devs currently i made an animated door using tween service but it is not working.
Could anyone help me?

Scripts
open = false

door1 = script.Parent.Parent.Parent.Door1

local Open2 = TweenService:Create(door2,tweenInfo,Door2Open)

local Close1 = TweenService:Create(door1,tweenInfo,Door1Close)

local Close2 = TweenService:Create(door2,tweenInfo,Door2Close)



script.Parent.MouseClick:connect(function()

if open == false then

Open1:Play()

Open2:Play()

wait(2)

open = true

else

Close1:Play()

 Close2:Play()

  wait(2)

 open = false

 end

 end)
1 Like

Not a solution, but a tip:
Replace Wait(2) with TweenBase.Completed:Wait()

TweenBase here is Open1, Open2, Close1, Close2.

Could you show us the PropertyTable? (Third argument of TweenService:Create())

I’m guessing you only copied part of the code? It starts with “local Open2 =” but doesn’t show “local Open1 =” at all.

Please debug your own code and attempt to fix it yourself first before posting threads to the forums. As well, “it’s not working” is not a sufficient enough explanation regarding the problems in your code. You need to identify the exact problem and isolate the code so it’s easier to help you.

Sorry I actually the I made a mistake.
I didn’t put the first 2 lines.I have edited the post. :grimacing:

this doesnt work in case ur doors are made of many parts and welded together

I see your 3rd line sets the variable “Open2”, but when you have “Open1:Play()” on line 8 I don’t see where you set the variable Open1…

That’s it sorry for my silly mistake.

Hehe, no worries! I’ve stared at my code for hours sometimes wondering why it wasn’t working & trying all sorts of ‘fixes’ then finally notice a spelling error or fault. No apologies necessary.

1 Like