Can you guys review my code and tell me what did I do wrong?

For some reason, the code I wrote is not working. Please review it and tell me what did I do wrong.

local TweenService = game:GetService("TweenService")

local part = game.Workspace.Part
part.Transparency = 0

local tweeninfo = TweenInfo.new(5)

local goal = {}
goal.Transparency = 1

local tween = TweenService:Create(part, goal, tweeninfo)

tween:Play()
2 Likes

Did You check output? It often tells programmers what’s wrong with the code if there’s a bug.

3 Likes

Yea there’s an error in the output saying: Unable to cast to dictionary

1 Like

The second parameter should be tweeninfo and the third parameter should be goal. This means that this line of code should look like this:

local tween = TweenService:Create(part, tweeninfo, goal)
2 Likes

Oh, ill give it a try and see if it works

edit: Yea it works! Thank you so much mate!

I didn’t expect programming to be that accurate lol

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.