I want to make a door that opens after 5 seconds. I used wait() but instead of waiting, it tweens the door instantly.
Script:
local TweenService = game:GetService("TweenService")
local tweenPart = script.Parent.Door1
local tweenPart2 = script.Parent.Door2
local info = TweenInfo.new(
script.Parent.Open.TimeLength,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
false,
0
)
local goals = {
Position = script.Parent.Door1Open.Position
}
local goals2 = {
Position = script.Parent.Door2Open.Position
}
local tween = TweenService:Create(tweenPart, info, goals)
local tween2 = TweenService:Create(tweenPart2, info, goals2)
wait(5)
tween:Play()
tween2:Play()
Any help please?

2 comments
both tweens played at once, but maybe the problem was the code starts running when the game starts, before the loading screen. I increased wait to 20 but at tweeninfo, the timelength of the open sound is 0, means the door is instantly opened without tweening it.
alright