I look at roblox wiki scripting website to look for a proper tweening set up, But i get an error from output at line 20 about... Unable to cast to Dictionary

May someone help me what may i have done wrong?

local TweenService = game:GetService("TweenService") local part = script.Parent local mode = part.ColorsMode

local tweenInfo = TweenInfo.new( 2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, true, 0 )

local colorstable = { ['1'] = BrickColor.new('Really black'), ['2'] = BrickColor.new('Really red'), ['3'] = BrickColor.new('Really blue') }

local tween = TweenService:Create(part,tweenInfo,mode,colorstable)

mode:GetPropertyChangedSignal('Value'):Connect(function() part.BrickColor = colorstable[tostring(mode.Value)] tween:Play() end)

2 comments

0

The dictionaries keys are expected to be the properties to tween. You may want to use separate tweens and separate tables to tween them a colour at the time. Since duplicate keys are not possible.

0

What can i do beside singling it? Because that will not get me anywhere to the colors i want to change with the tween changing it.