Not sure why I am getting this error. Code:
local Cart = script.Parent.Elevator
local tweenService = game:GetService("TweenService")
local F0 = script.Parent.F0ElevatorDoor
local F1 = script.Parent.F1ElevatorDoor
local F2 = script.Parent.F2ElevatorDoor
local CurrentFloor = 0
local info = TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local function tweenModel(model, cframe, time)
local cframeValue = Instance.new("CFrameValue")
cframeValue.Value = model:GetPrimaryPartCFrame()
cframeValue:GetPropertyChangedSignal("Value"):connect(function()
model:SetPrimaryPartCFrame(cframeValue.Value)
end)
local info = TweenInfo.new(time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local tween = tweenService:Create(cframeValue, info, {Value = cframe})
tween:Play()
tween.Completed:connect(function()
cframeValue:Destroy()
end)
end
local CFrames = {
F0D1OP1 = script.Parent.F0ElevatorDoor.D1O.First.CFrame, -- F0D1OP1 - Floor, Door, State, Part
F0D1OP2 = script.Parent.F0ElevatorDoor.D1O.Second.CFrame,
F0D1OP3 = script.Parent.F0ElevatorDoor.D1O.Third.CFrame,
F0D2OP1 = script.Parent.F0ElevatorDoor.D2O.First.CFrame,
F0D2OP2 = F0.D2O.Second.CFrame,
F0D2OP3 = F0.D2O.Third.CFrame,
F0D1CP1 = F0.D1C.First.CFrame,
F0D1CP2 = F0.D1C.Second.CFrame,
F0D1CP3 = F0.D1C.Third.CFrame
-- end of floor 0
}
local F0OpenP1 = tweenService:Create(F0.Door1.First, info, CFrames.F0D1OP1)
local F0OpenP2 = tweenService:Create(F0.Door1.Second, info, CFrames.F0D1OP2)
local F0OpenP3 = tweenService:Create(F0.Door1.Third, info, CFrames.F0D1OP3)
F0OpenP1:Play()
F0OpenP2:Play()
F0OpenP3:Play()

1 comment
free upvote