On line 16 I get the error "Unable to cast to Dictionary". I searched everywhere and found nothing. Please help.
tween = game:GetService("TweenService")
info1 = script.Parent.Door1END.Position
info1end = script.Parent.Door1.Position
info2 = script.Parent.Door2END.Position
info2end = script.Parent.Door2.Position
canopen = true
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
while char do
wait(0.2)
if (char.HumanoidRootPart.Position - script.Parent.Rad.Position).Magnitude <= 7 then
if canopen then
canopen = false
script.Parent.Rad["Elevator Door Open"]:Play()
local tw = tween:Create(script.Parent.Door1.Position, 1, info1)
local tw2 = tween:Create(script.Parent.Door2.Position, 1, info2)
script.Parent.Rad["Elevator Door Open"]:Stop()
end
end
wait(0.2)
if (char.HumanoidRootPart.Position - script.Parent.Rad.Position).Magnitude > 7 then
if canopen == false then
script.Parent.Rad["Elevator Close"]:Play()
local tw = tween:Create(script.Parent.Door1.Position, 1, info1end)
local tw2 = tween:Create(script.Parent.Door2.Position, 1, info2end)
script.Parent.Rad["Elevator Close"]:Stop()
canopen = true
end
end
end
end)
end)

1 comment
Epic, tables to the rescue.