So, I’ve been receiving an error while tweening, which is “Unable to Cast to Dictionary”. I have already looked around the forum for solutions, but none of the solutions for other topics solve my problem.
My code is (ServerScript):
-- initial sizes & positions
-- right elevator out = pos: 17.2, 3.05, -23.5, size: 2.6, 6.1, 0.2
-- left elevator out = pos: 14.55, 3.05, -23.5, size: 2.6, 6.1, 0.2
-- right elevator in = pos: 14.55, 3.05, -24.1, size: 2.6, 6.1, 0.2
-- left elevator in = pos: 17.2, 3.05, -24.1, size: 2.6, 6.1, 0.2
local r = game.workspace.Elevator.ElevatorDoorParts.LeftElevatorIn
local LeftOut = game.workspace.Elevator.ElevatorDoorParts.LeftElevatorOut
local RightIn = game.workspace.Elevator.ElevatorDoorParts.RightElevatorIn
local RightOut = game.workspace.Elevator.ElevatorDoorParts.RightElevatorOut
local replicatedStorage = game:GetService("ReplicatedStorage")
local ElevatorTweenEvent = replicatedStorage:WaitForChild("ElevatorTween")
local tweenService = game:GetService("TweenService")
local PropertiesLeftIn = {
Position = 18.375, 3.05, -24.1,
Size = 0.25, 6.1, 0.2
}
local TweenInfoLeftIn = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local TweenLeftIn = tweenService:Create(r, TweenInfoLeftIn, PropertiesLeftIn)
ElevatorTweenEvent.OnServerEvent:Connect(function(player)
print("event was fired")
wait(4)
game.workspace.Elevator.ElevatorDoorParts.DoorDivider:Destroy()
TweenLeftIn:Play()
end)
Any solutions?