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

How do I properly cast a TweenService?

Whenever I try to play this TweenService I get an error saying "unable to cast to dictionary". here is the section of code -

local kickBtn = Bfolder.KickBtn
local selection
local function changeability(btn)
	re:FireServer(selection)
	TweenService:Create(btn.BackgroundColor,TweenInfo.new(.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false),{Color3.new(0, 1, 1)}):Play()
end

kickBtn.Activated:Connect(function()
	selection = "kick"
	changeability(kickBtn)
end)

I am confused as I don't seem to be casting from a dictionary (it should reference the selected button) so any help would be great.

1 answer

	local Tween = TweenService:Create(btn, TweenInfo.new(3), {BackgroundColor3 = Color3.new(0, 0, 0)})
	Tween:Play()

I figured it out for anyone else who might be facing the same issue

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