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?