I’m making a lift with 3 floors and a button for each. The lift has two sets of doors, an inside set and an outside set. The inside set is attached to the lift, whereas the outside set is not. The rest of the lift works well, but the inside doors don’t move when they’re supposed to (when the player presses the button). I’ve attached the relevant code although I’ll leave a link to the entire script too.
-- Rest of script for outside doors and lift which works fine.
-- There is also a script which welds the inside doors to the rest of the lift.
local InDoorGoals1 = {CFrame = Lift.CFrame*CFrame.new(-7.71,5.8,-5.5)}
local InDoorGoals2 = {CFrame = Lift.CFrame*CFrame.new(7.71,5.8,-5.5)}
local InDoorCloseGoals1 = {CFrame = Lift.CFrame*CFrame.new(-2.71,5.8,-5.5)}
local InDoorCloseGoals2 = {CFrame = Lift.CFrame*CFrame.new(2.71,5.8,-5.5)}
local TweenIndoor1 = TweenService:Create(InDoor1, DoorOpenTweenfo, InDoorGoals1)
local TweenIndoor2 = TweenService:Create(InDoor2, DoorOpenTweenfo, InDoorGoals2)
local TweenCloseIndoor1 = TweenService:Create(InDoor1, DoorOpenTweenfo, InDoorCloseGoals1)
local TweenCloseIndoor2 = TweenService:Create(InDoor2, DoorOpenTweenfo, InDoorCloseGoals2)
local function CloseInDoors()
TweenCloseIndoor1:Play()
TweenCloseIndoor2:Play()
end
local function InDoors()
TweenIndoor1:Play()
TweenIndoor2:Play()
end
CD1.MouseClick:Connect(function()
CloseDoors() -- (Outside doors)
wait()
CloseInDoors() -- (Inside doors)
wait(2)
TweenLift1:Play()
TweenLift1.Completed:Connect(function()
InDoors()
wait()
OpenDoor(TweenDoor[1])
end)
end)
CD2.MouseClick:Connect(function()
CloseDoors()
wait()
CloseInDoors()
wait(2)
TweenLift2:Play()
TweenLift2.Completed:Connect(function()
InDoors()
wait()
OpenDoor(TweenDoor[2])
end)
end)
CD3.MouseClick:Connect(function()
CloseDoors()
wait()
CloseInDoors()
wait(2)
TweenLift3:Play()
TweenLift3.Completed:Connect(function()
InDoors()
wait()
OpenDoor(TweenDoor[3])
end)
end)
Video showing the problem (the grey doors should open at each stop):
The whole script (ignore the comments): Paste code - paste.org