Hello, I have a problem with tweening parts.
Here is the script:
local TweenService = game:GetService("TweenService")
local ScriptsFolder = game.Workspace.Scripts
local ButtonsFolder = ScriptsFolder.Buttons
local Button_1 = ButtonsFolder.ButtonTrap_1.PartClicked.Attachment.ProximityPrompt
local ButtonPartUp_1 = ButtonsFolder.ButtonTrap_1.PartNormal
local ButtonPartDown_1 = ButtonsFolder.ButtonTrap_1.PartClicked
local AffectedThings = ButtonsFolder.ButtonTrap_1.AffectedThings
local ButtonSound = ButtonPartDown_1.Sound
local Plate1 = AffectedThings.Plate1
local Plate2 = AffectedThings.Plate2
local Plate3 = AffectedThings.Plate3
local Plate4 = AffectedThings.Plate4
local Plate5 = AffectedThings.Plate5
local tweenInfo = TweenInfo.new(1.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, false, 0)
local tween1 = TweenService:Create(Plate1, tweenInfo, {Position = Vector3.new(Plate1.Position.X, -282.577, Plate1.Position.Z)})
local tween2 = TweenService:Create(Plate2, tweenInfo, {Position = Vector3.new(Plate2.Position.X, -282.577, Plate2.Position.Z)})
local tween3 = TweenService:Create(Plate3, tweenInfo, {Position = Vector3.new(Plate3.Position.X, -282.577, Plate3.Position.Z)})
local tween4 = TweenService:Create(Plate4, tweenInfo, {Position = Vector3.new(Plate4.Position.X, -282.577, Plate4.Position.Z)})
local tween5 = TweenService:Create(Plate5, tweenInfo, {Position = Vector3.new(Plate5.Position.X, -282.577, Plate5.Position.Z)})
local Used = false
Button_1.Triggered:Connect(function()
if Used == false then
Used = true
Plate1.CanCollide = false
Plate2.CanCollide = false
Plate3.CanCollide = false
Plate4.CanCollide = false
Plate5.CanCollide = false
tween1:Play()
tween2:Play()
tween3:Play()
tween4:Play()
tween5:Play()
task.wait(5)
Plate1.Position = Vector3.new(Plate1.Position.X, -187.777, Plate1.Position.Z)
Plate2.Position = Vector3.new(Plate2.Position.X, -187.777, Plate2.Position.Z)
Plate3.Position = Vector3.new(Plate3.Position.X, -187.777, Plate3.Position.Z)
Plate4.Position = Vector3.new(Plate4.Position.X, -187.777, Plate4.Position.Z)
Plate5.Position = Vector3.new(Plate5.Position.X, -187.777, Plate5.Position.Z)
Plate1.CanCollide = true
Plate2.CanCollide = true
Plate3.CanCollide = true
Plate4.CanCollide = true
Plate5.CanCollide = true
Plate1.Transparency = 0
Plate2.Transparency = 0
Plate3.Transparency = 0
Plate4.Transparency = 0
Plate5.Transparency = 0
end
end)
So the problem is that the tween is getting Actived twice.