Pillars won't go down

So I have a model of Sliding doors but I want to put it on my pillars and they down but when I put the script in the model the door goes down but model doesn’t.

https://gyazo.com/65cb76fecbfc3e13ca498ebfde16654e

The 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(7)

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)

Have you tried doing this with “Attachment” instead of script?

No the script works, but it won’t attach.

I think because it isn’t PartInstance

It is possible to do this with Attachment and HingeConstraint. You do not need a script file. Related article:

Do you want it to spin (move) only when the player passes the piece?

No no, I need when you press a button 3 from the front and back go down and when pressed again it goes down.

Like ProximityPrompt :grey_question:

I don’t know, I really don’t know anything on scripting

No problem. Give me about 5 minutes to do this :slight_smile:

Ok thanks, I really appreciate that.

You want this to be animated :grey_question:

Yes pls Tween, again I really appreciate it.

So when it is done do I just put the script in the model?

Yes, wait a minute. I will send it to you as soon as possible. You don’t need to wait.

1 Like

Put this on the part you want to tween.
put it in script form. Let me know if there are any errors.

    local tweenService = game:GetService("TweenService")
    local part = script.Parent
    local tweeningInformation = TweenInfo.new(

    5, -- Length

    Enum.EasingStyle.Bounce, -- Easing style
    Enum.EasingDirection.Out, -- Easing direction

    100, -- Number of times the tween will repeat
    true, -- Should the tween repeat?
    2 -- Delay between each tween
    )

   script.Parent.ProximityPrompt.TriggerEnded:Connect(function()
   local partProperties = {
   Size = Vector3.new(3.7, 5.1, 4);
  Color = Color3.new(0.937255, 0.937255, 0.937255); --- Optional
  Transparency = 0  --- Optional
  }
 local Tween = tweenService:Create(part,tweeningInformation,partProperties)
 Tween:Play()
 end)

How do I activate it? Because idk how

Make sure you add ProximityPrompt.

Edit: You can set it according to itself via ProximityPrompt.

I added it but it isn’t going down (it is to the script or the model?)

And I want it connected to a button, any ideas?