local lpassdoor = script.Parent.Parent.PassengerDoors.DoorLockL
local rpassdoor = script.Parent.Parent.PassengerDoors.DoorLock
local passdoor = script.Parent.Parent.PassengerDoors
local TweenService = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(
3,
Enum.EasingStyle.Quart,
Enum.EasingDirection.Out,
0,
false,
0
)
script.Parent.OnServerEvent:Connect(function(plr, state, side)
if side == "Left" then
if state == false then
lpassdoor.Value = false
for i, v in pairs(script.Parent.Parent.Metro4000.Train.DriveSystem:GetDescendants()) do
if v.ClassName == "Part" then
v.Anchored = true
end
end
for _, model in pairs(passdoor:GetDescendants()) do
if model.Name == "LeftSide" then
model.Door.Union.Anchored = true
model.Door2.Union.Anchored = true
for i, object in pairs(model:GetDescendants()) do
if object.Name == "Colour" then
object.Color = Color3.fromRGB(0, 255, 0)
end
end
end
end
elseif state == true then
lpassdoor.Value = true
passdoor.Part.Beep:Play()
passdoor.Part.Beep.Ended:Wait()
passdoor.Part.AirReleas:Play()
for i, v in pairs(passdoor:GetChildren()) do
if v.Name == "LeftSide" then
for i, col in pairs(v:GetChildren()) do
if col.Name == "Colour" then
col.Color = Color3.fromRGB(255, 0, 0)
end
if v.Toggle.Value == true then
local ClosePos1 = {CFrame = v.Door.Union.CFrame * CFrame.new(0,-2.6,0)}
local ClosePos2 = {CFrame = v.Door2.Union.CFrame * CFrame.new(0,2.6,0)}
local Close1 = TweenService:Create(v.Door.Union, tweeninfo, ClosePos1)
local Close2 = TweenService:Create(v.Door2.Union, tweeninfo, ClosePos2)
Close1:Play()
Close2:Play()
v.Toggle.Value = false
lpassdoor.Value = true
end
v.Door.Union.Anchored = false
v.Door2.Union.Anchored = false
end
end
end end
Hi everyone, my issue is that my tween is/isn’t playing. It takes the door the amount of time needed to do the tween but it doesn’t actually slide, it just magically pops to where it’s supposed to be. The part of the script I have the issue with is:
local ClosePos1 = {CFrame = v.Door.Union.CFrame * CFrame.new(0,-2.6,0)}
local ClosePos2 = {CFrame = v.Door2.Union.CFrame * CFrame.new(0,2.6,0)}
local Close1 = TweenService:Create(v.Door.Union, tweeninfo, ClosePos1)
local Close2 = TweenService:Create(v.Door2.Union, tweeninfo, ClosePos2)
Close1:Play()
Close2:Play()
v.Toggle.Value = false
lpassdoor.Value = true
end
I’m unsure as to why this is happening, if you need anything else to help like pictures of the train layout etc, just say.