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

How do I properly cast a TweenService?

Asked by 2 years ago

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

Log in to vote
0
Answered by 2 years ago
    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

Ad

Answer this question