Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Line 16: Unable to cast to Dictionary? (fixed)

Asked by 5 years ago
Edited 5 years ago

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 answer

Log in to vote
0
Answered by 5 years ago

I figured it out myself fixed the error thanks

0
Epic, tables to the rescue. ForeverBrown 356 — 5y
Ad

Answer this question