Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this tweening showing unable to cast dictionary error?

The script I have written isn't functioning as needed. When I run the game an error appears in line 6 saying unable to cast dictionary error.

anf = script.Parent.ViewportFrame.Folder
Goals = {} 

Goals.CFrame = CFrame.new(-1017.90277, 1.26408625, -1022.59729)
info = TweenInfo.new(0.3,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0)
tween = TS:Create(anf.Top, Goalsl, info)

tween:Play()

2 answers

✓ Accepted answer

TweenInfo must be the second parameter of TweenService:Create and property table third, you also made a typo, "Goalsl" should be "Goals":

local tween = TS:Create(anf.Top, info, Goals)

It's good to put local before variables to localize them and improve performance.

Well, its a simple typo you made.

On line six, 2nd parameter of TS:Create(), you used Goals1, instead of Goals[1]

This discussion is preserved as it was. New answers, comments, and votes are closed.