Needing it to go down

Hi, I followed a tutorial of tweening and it worked but I need them to all go down any ideas

Script :

local TweenService = game:GetService(“TweenService”)

local model = script.Parent
local leftDoor = model.LeftDoor
local rightDoor = model.RightDoor
local prompt = model.Top.Attachment.ProximityPrompt

local tweenInfo = TweenInfo.new(1)

local leftGoalOpen = {}
local leftGoalClose = {}
leftGoalOpen.CFrame = leftDoor.CFrame * CFrame.new(leftDoor .Size.X, 0, 0)
leftGoalClose.CFrame = leftDoor.CFrame
local leftTweenOpen = TweenService:Create(leftDoor, tweenInfo, leftGoalOpen)
local leftTweenClose = TweenService:Create(leftDoor, tweenInfo, leftGoalClose)

local rightGoalOpen = {}
local rightGoalClose = {}
rightGoalOpen.CFrame = rightDoor.CFrame * CFrame.new(-rightDoor .Size.X, 0, 0)
rightGoalClose.CFrame = rightDoor.CFrame
local rightTweenOpen = TweenService:Create(rightDoor, tweenInfo, rightGoalOpen)
local rightTweenClose = TweenService:Create(rightDoor, tweenInfo, rightGoalClose)

prompt.Triggered:Connect(function()
if prompt.ActionText ==“Close” then
leftTweenClose:Play{}
rightTweenClose:Play{}
prompt.ActionText = “Open”
else
leftTweenOpen:Play{}
rightTweenOpen:Play{}
prompt.ActionText = “Close”
end

end)

1 Like

So do you want the tweens to bring the parts down? Or do you mean play the tweens.

I want to make the tweens go down.

I think you need to change {} to () when you want to play the tweens.

1 Like

I tried that and now it won’t move, and there is a red underline under it.

Check the output, are there any errors?

There are red underlines under the () now

Did you change

local leftGoalOpen = {}
local leftGoalClose = {}

local rightGoalOpen = {}
local rightGoalClose = {}

to

local leftGoalOpen = ()
local leftGoalClose = ()

local rightGoalOpen = ()
local rightGoalClose = ()

https://gyazo.com/2afcc31fc35ab89803e73cf3fd2d2cba

Use this:

local TweenService = game:GetService("TweenService")

local model = script.Parent
local leftDoor = model.LeftDoor
local rightDoor = model.RightDoor
local prompt = model.Top.Attachment.ProximityPrompt

local tweenInfo = TweenInfo.new(1)

local leftGoalOpen = {}
local leftGoalClose = {}
leftGoalOpen.CFrame = leftDoor.CFrame * CFrame.new(leftDoor .Size.X, 0, 0)
leftGoalClose.CFrame = leftDoor.CFrame
local leftTweenOpen = TweenService:Create(leftDoor, tweenInfo, leftGoalOpen)
local leftTweenClose = TweenService:Create(leftDoor, tweenInfo, leftGoalClose)

local rightGoalOpen = {}
local rightGoalClose = {}
rightGoalOpen.CFrame = rightDoor.CFrame * CFrame.new(-rightDoor .Size.X, 0, 0)
rightGoalClose.CFrame = rightDoor.CFrame
local rightTweenOpen = TweenService:Create(rightDoor, tweenInfo, rightGoalOpen)
local rightTweenClose = TweenService:Create(rightDoor, tweenInfo, rightGoalClose)

prompt.Triggered:Connect(function()
	if prompt.ActionText == "CLose" then
		leftTweenClose:Play()
		rightTweenClose:Play()
		prompt.ActionText = "Open"
	else
		leftTweenOpen:Play()
		rightTweenOpen:Play()
		prompt.ActionText = "CLose"
	end

end)
1 Like

That’s the same script but without the line in the middle.

Did you try using the script or not?

Yes I did and the same error happened :frowning:

can i you send me your script please

Ok sure “I need 30 words to type a reply”

Are you still doing the script?

There isn’t much information for people to go off of, can you show the layout of your doors and where the scripts are? The more info the easier it becomes for everyone else!

Also, i believe it is unnecessary to create both open and closed goals if only one will be used, instead you should use conditionals to make one for each instead of two!