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

Tweening function errors even though nothing seems to be wrong?

Asked by 4 years ago
Edited 4 years ago
function tweenfunc(inst,oof,len,a,b,c)
    local info = TweenInfo.new(
        len,
        Enum.EasingStyle.Linear,
        Enum.EasingDirection.Out,
        0,
        false,
        0    
    )
    local changes = {
        if oof == "BackgroundColor3" then
            BackgroundColor3 = Color3.fromHSV(a,b,c)
        elseif oof == "BorderColor3" then
            BorderColor3 = Color3.fromHSV(a,b,c)
        elseif oof == "ScrollBarImageColor3" then
            ScrollBarImageColor3 = Color3.fromHSV(a,b,c)
        elseif oof == "ImageColor3" then
            ImageColor3 = Color3.fromHSV(a,b,c)
        elseif oof == "BackgroundTransparency" then
            BackgroundTransparency = a
        elseif oof == "ImageTransparency" then
            ImageTransparency = a
        end
    }
    local tw = game:GetService("TweenService"):Create(inst,info,changes)
    tw:Play()
end

returns the error '}' expected (to close '{') near 'end' how would i fix this?

Answer this question